Skip to content

Commit

Permalink
fix: 서브내비 로직 가독성 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
Limchansol committed Mar 4, 2025
1 parent c4ba701 commit abac8e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion components/layout/pageLayout/MajorCategoryPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default function MajorCategoryPageLayout({
<HTMLViewer
htmlContent={description}
wrapperClassName="mb-6 mt-8 hidden sm:block"
// contentClassName={{ color: '#f5f5f5', maxWidth: 960 }}
contentClassName="!text-[#f5f5f5] max-w-[960px]"
/>
)}
Expand Down
9 changes: 3 additions & 6 deletions components/layout/pageLayout/SubNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useTranslations } from 'next-intl';

import { CurvedVerticalNode } from '@/components/common/Nodes';
import NavLabel from '@/components/layout/navbar/NavLabel';
import { community, council, SegmentNode } from '@/constants/segmentNode';
import { council, SegmentNode } from '@/constants/segmentNode';
import { Link } from '@/i18n/routing';
import useStyle from '@/utils/hooks/useStyle';
import { getAllSubTabs, getDepth, getPath, getRootTab } from '@/utils/page';
Expand All @@ -20,11 +20,8 @@ const INDENTATION = 16;
export default function SubNavbar({ currentTab }: { currentTab: TreeNode }) {
const t = useTranslations('Nav');
const rootTab = getRootTab(currentTab as SegmentNode);
const subTabs =
// 학생회 하위 탭은 서브내비 노출 X
rootTab === community
? getAllSubTabs(rootTab).filter((tab) => tab.parent !== council)
: getAllSubTabs(rootTab);
// 학생회 하위 탭은 서브내비 노출 X
const subTabs = getAllSubTabs(rootTab).filter((tab) => tab.parent !== council);

const height = `${(subTabs.length + 1) * ITEM_HEIGHT}px`;

Expand Down

0 comments on commit abac8e7

Please sign in to comment.