From 92a4b9afa93b5a237fa8fca6ebb62b28ef830f6f Mon Sep 17 00:00:00 2001 From: ccwnc Date: Tue, 16 Apr 2024 13:36:07 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20path=EB=A5=BC=20prop=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=9B=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/header/Header/index.tsx | 7 ++++--- src/components/header/UserMenu/index.tsx | 19 ++++++++++++++----- .../header/buttons/HeaderSigninButton.tsx | 10 ++++++---- .../header/buttons/HeaderSignupButton.tsx | 10 ++++++---- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/components/header/Header/index.tsx b/src/components/header/Header/index.tsx index d017123e..71157010 100644 --- a/src/components/header/Header/index.tsx +++ b/src/components/header/Header/index.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames/bind'; -import { PAGE_PATHS, SVGS } from '@/constants'; +import { SVGS } from '@/constants'; import Menu from '@/components/header/Menu'; @@ -11,19 +11,20 @@ const { url, alt } = SVGS.drawerMenu; type HeaderProps = { children: React.ReactNode; + path: string; logoName: string; menuList: string[]; onClick: () => void; }; -const Header = ({ children, logoName, menuList, onClick }: HeaderProps) => { +const Header = ({ children, path, logoName, menuList, onClick }: HeaderProps) => { return (
- + {logoName}
diff --git a/src/components/header/UserMenu/index.tsx b/src/components/header/UserMenu/index.tsx index 3e72a705..4c5f9885 100644 --- a/src/components/header/UserMenu/index.tsx +++ b/src/components/header/UserMenu/index.tsx @@ -2,7 +2,7 @@ import { RefObject } from 'react'; import classNames from 'classnames/bind'; -import { PAGE_PATHS, SVGS } from '@/constants'; +import { SVGS } from '@/constants'; import Avatar from '@/components/Avatar'; import useSignout from '@/hooks/useSignout'; @@ -11,17 +11,26 @@ import styles from './UserMenu.module.scss'; const cx = classNames.bind(styles); const { url, alt } = SVGS.button.setting; -const { account, mypage } = PAGE_PATHS; type UserMenuProps = { profileImageUrl: string; nickname: string; email: string; + accountPath: string; + mypagePath: string; userMenuRef: RefObject; onClick: () => void; }; -const UserMenu = ({ profileImageUrl, nickname, email, userMenuRef, onClick }: UserMenuProps) => { +const UserMenu = ({ + profileImageUrl, + nickname, + email, + accountPath, + mypagePath, + userMenuRef, + onClick, +}: UserMenuProps) => { const signout = useSignout(); const handleClickSignout = () => { @@ -36,7 +45,7 @@ const UserMenu = ({ profileImageUrl, nickname, email, userMenuRef, onClick }: Us

{nickname}

- + {alt}
@@ -44,7 +53,7 @@ const UserMenu = ({ profileImageUrl, nickname, email, userMenuRef, onClick }: Us
- + My Page diff --git a/src/components/header/buttons/HeaderSignupButton.tsx b/src/components/header/buttons/HeaderSignupButton.tsx index 71e14e33..24e8ae1d 100644 --- a/src/components/header/buttons/HeaderSignupButton.tsx +++ b/src/components/header/buttons/HeaderSignupButton.tsx @@ -1,14 +1,16 @@ import classNames from 'classnames/bind'; -import { PAGE_PATHS } from '@/constants'; - import styles from './HeaderSignButton.module.scss'; const cx = classNames.bind(styles); -export const HeaderSignupButton = () => { +type HeaderSignupButtonProps = { + path: string; +}; + +export const HeaderSignupButton = ({ path }: HeaderSignupButtonProps) => { return ( - +