From ffb9c1cb424d215061faf009f257616e95aaf6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=92=E1=85=A2=E1=84=89?= =?UTF-8?q?=E1=85=A5=E1=86=BC?= Date: Wed, 17 Apr 2024 00:29:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20PCPanel=20=EA=B6=8C=ED=95=9C=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 1 - .../common/Header/MobilePanel/index.tsx | 6 +- src/component/common/Header/PCPanel/index.tsx | 134 ++++++++++-------- 3 files changed, 78 insertions(+), 63 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index beae9bec..869b781e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -59,7 +59,6 @@ function App() { } /> } /> } /> - } /> } /> diff --git a/src/component/common/Header/MobilePanel/index.tsx b/src/component/common/Header/MobilePanel/index.tsx index add1477a..e334e6a1 100644 --- a/src/component/common/Header/MobilePanel/index.tsx +++ b/src/component/common/Header/MobilePanel/index.tsx @@ -13,12 +13,12 @@ import useUserTypeStore from 'store/userType'; import { CATEGORY_COOP, CATEGORY_OWNER, HeaderCategory } from 'utils/constant/category'; import styles from './MobilePanel.module.scss'; -interface Props { +interface Prop { hideSidebar: () => void; category: HeaderCategory; } -function HeaderContent({ hideSidebar, category }: Props) { +function PanelContent({ hideSidebar, category }: Prop) { const { title, submenu } = category; return ( @@ -132,7 +132,7 @@ export default function MobilePanel() { {targetCategory.map((category: HeaderCategory) => ( - + ))} state); - const { logout } = useLogout(); +interface Prop { + categoryArray: HeaderCategory[]; +} +function HeaderContent({ categoryArray }: Prop) { const { panelMenuList, isExpanded: isMegaMenuExpanded, createOnChangeMenu, onFocusPanel, hideMegaMenu, - } = useMegaMenu(CATEGORY_OWNER); + } = useMegaMenu(categoryArray); + + return ( +
+
    + {categoryArray.map((category) => ( +
  • + +
  • + ))} +
+ +
ID[`LABEL${index + 1}`]).join(' ')} + > +
    + {panelMenuList?.map((menu) => ( +
  • + + {menu.title} + +
  • + ))} +
+
+
+ ); +} + +export default function PCPanel() { + const navigate = useNavigate(); + + const { setPrevPath } = usePrevPathStore((state) => state); + const { logout } = useLogout(); + const { userType } = useUserTypeStore(); + + const targetCategory = userType === 'OWNER' ? CATEGORY_OWNER : CATEGORY_COOP; const handleLogout = () => { logout(undefined, { @@ -45,63 +109,15 @@ export default function PCPanel() { > -
-
    - {CATEGORY_OWNER.map((category: HeaderCategory) => ( -
  • - -
  • - ))} -
-
ID[`LABEL${index + 1}`]).join(' ')} - > -
    - {panelMenuList?.map((menu) => ( -
  • - - {menu.title === '가게정보' && menu.title} - -
  • - ))} -
-
-
+ +
    {/* Auth 완료시 수정 필요 */} -
  • + {/*
  • 정보수정 -
  • + */}