diff --git a/src/assets/icons/CallIcon.svg b/src/assets/icons/CallIcon.svg new file mode 100644 index 00000000..d0862ca2 --- /dev/null +++ b/src/assets/icons/CallIcon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/images/.gitkeep b/src/assets/images/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/assets/images/applyButton.jpeg b/src/assets/images/applyButton.jpeg new file mode 100644 index 00000000..87018420 Binary files /dev/null and b/src/assets/images/applyButton.jpeg differ diff --git a/src/components/Common/Button.tsx b/src/components/Common/Button.tsx new file mode 100644 index 00000000..35b2f7f0 --- /dev/null +++ b/src/components/Common/Button.tsx @@ -0,0 +1,57 @@ +import CallIcon from '@/assets/icons/CallIcon.svg?react'; +import { buttonTypeKeys, buttonTypeUnion } from '@/constants/components'; + +type buttonProps = { + type: buttonTypeUnion; // 정의된 버튼을 5가지 타입으로 나누었습니다. + bgColor: string; // 버튼의 배경색 + fontColor: string; // 버튼 글자색 + isCallIcon?: boolean; // 전화기 아이콘 여부 (optional) + isBorder: boolean; // 버튼 테두리 여부 + title: string; // 버튼에 포함되는 글자 + onClick?: () => void; // 클릭 이벤트 핸들러 (optional) +}; + +const Button = ({ + type, + bgColor, + fontColor, + isCallIcon = false, // 기본값 false 설정 + isBorder, + title, + onClick, +}: buttonProps) => { + const getButtonStyle = () => { + switch (type) { + case buttonTypeKeys.LARGE: + return 'w-[20.5rem] py-4 flex justify-center items-center rounded-[2rem] text-[1rem]'; + case buttonTypeKeys.SMALL: + return 'w-[5.5rem] py-3 flex justify-center items-center rounded-[1.25rem] text-[0.75rem]'; + case buttonTypeKeys.APPLY: + return `w-[20.5rem] py-4 flex justify-center items-center rounded-[2rem] bg-[url("/src/assets/images/applyButton.jpeg")] bg-cover bg-center text-[1rem] text-[#F4F4F9]`; + case buttonTypeKeys.BACK: + return 'w-[7.5rem] py-4 flex justify-center items-center rounded-[2rem] text-[1rem]'; + case buttonTypeKeys.CONTINUE: + return 'w-[12.5rem] py-4 flex justify-center items-center rounded-[2rem] text-[1rem]'; + default: // 기본값으로 large type 적용 + return 'w-[20.5rem] py-4 flex justify-center items-center rounded-[2rem] text-[1rem]'; + } + }; + + return ( + + ); +}; + +export default Button; diff --git a/src/constants/components.ts b/src/constants/components.ts new file mode 100644 index 00000000..7a59fddc --- /dev/null +++ b/src/constants/components.ts @@ -0,0 +1,9 @@ +export const buttonTypeKeys = { + LARGE: 'large', + SMALL: 'small', + APPLY: 'applyNow', + BACK: 'back', + CONTINUE: 'continue', +} as const + +export type buttonTypeUnion = typeof buttonTypeKeys[keyof typeof buttonTypeKeys] \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js index 80399346..81b8e901 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -6,8 +6,10 @@ export default { fontFamily: { pretendard: ['"Pretendard"', 'sans-serif'], }, + backgroundImage:{ navbarGradient : 'linear-gradient(270deg, #FEFEFE 0.35%, #F4F4F9 175.32%)', + grayGradient : 'linear-gradient(180deg, rgba(255, 255, 255, 0.80) 36.54%, #FFF 94.71%)' } }, },