diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index e5426c04..4e10b2a3 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { useRouter } from 'next/router'; import Image from 'next/image'; import { useToast } from '../ui/use-toast'; +import { HeaderProps } from '@/types/Header'; import LOGO_ICON from '../../../public/epigram-icon.png'; import ARROW_LEFT_ICON from '../../../public/icon/arrow-left-icon.svg'; import PROFILE_ICON from '../../../public/icon/profile-icon.svg'; @@ -18,19 +19,6 @@ import SHARE_ICON from '../../../public/icon/share-icon.svg'; // TODO isButton 일 경우 textInButton의 값을 무조건 지정해줘야 합니다. // TODO SHARE_ICON 추가 시 토스트 기능도 사용하려면 해당 컴포넌트 아래 를 추가해주세요. -interface HeaderProps { - icon: 'back' | 'search' | ''; - routerPage: string; - isLogo: boolean; - insteadOfLogo: string; - isProfileIcon: boolean; - isShareIcon: boolean; - isButton: boolean; - textInButton: string; - disabled: boolean; - onClick: (e: React.MouseEvent) => void; -} - function Header({ isLogo, icon, insteadOfLogo, isButton, isProfileIcon, isShareIcon, textInButton, routerPage, disabled, onClick }: HeaderProps) { const router = useRouter(); const { toast } = useToast(); diff --git a/src/types/Header.ts b/src/types/Header.ts new file mode 100644 index 00000000..a75d1fce --- /dev/null +++ b/src/types/Header.ts @@ -0,0 +1,12 @@ +export interface HeaderProps { + icon: 'back' | 'search' | ''; + routerPage: string; + isLogo: boolean; + insteadOfLogo: string; + isProfileIcon: boolean; + isShareIcon: boolean; + isButton: boolean; + textInButton: string; + disabled: boolean; + onClick: (e: React.MouseEvent) => void; +}