Skip to content

Commit

Permalink
fix: comfrim type of HEADER_LABEL and label in HeaderProps
Browse files Browse the repository at this point in the history
  • Loading branch information
GBAJS754 committed Apr 4, 2024
1 parent e1ae742 commit bd6b18e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ import { MdOutlineSearch } from 'react-icons/md';
import CloseButton from '../CloseButton';
import HeaderText from '../HeaderText';

const HEADER_LABEL = {
search: '검색',
news: '뉴스',
} as const

type label = keyof typeof HEADER_LABEL;

type HeaderProps = {
label: 'search' | 'news';
label: label ;
type?: 'close' | 'search';
path?: string;
};

const Header = ({ label, type, path }: HeaderProps) => {
const navigate = useNavigate();
const HEADER_LABEL = {
search: '검색',
news: '뉴스',
};

const HEADER_TYPE = {
close: <CloseButton onClick={() => (path ? navigate(path) : navigate(-1))} />,
Expand Down

0 comments on commit bd6b18e

Please sign in to comment.