Skip to content

Commit

Permalink
FE-50 ✨fix: types 폴더에 interface 정의
Browse files Browse the repository at this point in the history
  • Loading branch information
imsoohyeok committed Jul 12, 2024
1 parent 49dd79c commit c48c141
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 1 addition & 13 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -18,19 +19,6 @@ import SHARE_ICON from '../../../public/icon/share-icon.svg';
// TODO isButton 일 경우 textInButton의 값을 무조건 지정해줘야 합니다.
// TODO SHARE_ICON 추가 시 토스트 기능도 사용하려면 해당 컴포넌트 아래 <Toaster /> 를 추가해주세요.

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<HTMLButtonElement>) => void;
}

function Header({ isLogo, icon, insteadOfLogo, isButton, isProfileIcon, isShareIcon, textInButton, routerPage, disabled, onClick }: HeaderProps) {
const router = useRouter();
const { toast } = useToast();
Expand Down
12 changes: 12 additions & 0 deletions src/types/Header.ts
Original file line number Diff line number Diff line change
@@ -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<HTMLButtonElement>) => void;
}

0 comments on commit c48c141

Please sign in to comment.