Skip to content

Commit

Permalink
chore :: sidebar 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dutexion committed May 14, 2024
1 parent 1de3057 commit 82df804
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/components/common/sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Params, useLocation, useNavigate, useParams } from 'react-router-dom';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { default as styled } from '@emotion/styled';
import { Dispatch, SetStateAction } from 'react';
import { menu as menuList } from './menus';
Expand Down Expand Up @@ -27,8 +27,8 @@ export const Sidebar = ({ isOpen, setOpen }: PropType) => {
const params: any = useParams();
const navigate = useNavigate();
const raw_pathname = rawPath(pathname);
const menuData = menuList[raw_pathname] || { back: undefined, menu: [] }; // 데이터가 없는 경우를 대비한 기본값 설정
const { back, menu: menus } = menuData; // 이제 여기서 구조 분해 할당을 사용합니다.
const menuData = menuList[raw_pathname] || { back: undefined, menu: [] };
const { back, menu: menus } = menuData;

return (
<Wrapper isOpen={isOpen}>
Expand Down
36 changes: 23 additions & 13 deletions src/components/common/sidebar/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const deploy_inside = {
back: '/team/-team-/deploy',
menu: [
{ icon: 'material-symbols:file-copy-outline', name: '배포 관리', link: '/team/-team-/deploy/-deploy-' },
{ icon: 'f7:shippingbox', name: '컨테이너', link: `/team/-team-/deploy` },
{ icon: 'f7:shippingbox', name: '컨테이너', link: `/team/-team-/deploy/-deploy-/container` },
],
};

Expand All @@ -47,24 +47,34 @@ export const menu: MenusType = {
'/team/:id/container': deploy,
'/team/:id/deploy/:id': deploy_inside,
'/team/:id/deploy/:id/container': deploy_inside,
'/team/:id/deploy/:id/container/:id': {
'/team/:id/deploy/:id/container/detail': {
back: '/team/-team-/deploy/-deploy-/container',
menu: [
{
icon: 'f7:shippingbox',
name: '컨테이너 상태',
link: 'team/-team-/deploy/-deploy-/container/-container-',
},
{
icon: 'ph:list-bold',
name: '배포 내역',
link: `team/-team-/deploy/-deploy-/container/-container-/history`,
},
{
icon: 'uil:analytics',
name: '요청 통계',
link: `team/-team-/deploy/-deploy-/container/-container-/analytics`,
link: '/team/-team-/deploy/-deploy-/container/detail',
},
],
},
// '/team/:id/deploy/:id/container/:id': {
// back: '/team/-team-/deploy/-deploy-/container',
// menu: [
// {
// icon: 'f7:shippingbox',
// name: '컨테이너 상태',
// link: '/team/-team-/deploy/-deploy-/container/-container-',
// },
// {
// icon: 'ph:list-bold',
// name: '배포 내역',
// link: `/team/-team-/deploy/-deploy-/container/-container-/history`,
// },
// {
// icon: 'uil:analytics',
// name: '요청 통계',
// link: `/team/-team-/deploy/-deploy-/container/-container-/analytics`,
// },
// ],
// },
};

0 comments on commit 82df804

Please sign in to comment.