Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit 2df78e0

Browse files
authored
✨ 학생회 중분류 페이지 추가 (#310)
1 parent 9156bdf commit 2df78e0

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout';
2+
import { council } from '@/constants/segmentNode';
3+
import { getMetadata } from '@/utils/metadata';
4+
5+
export async function generateMetadata(props: { params: Promise<{ locale: string }> }) {
6+
const params = await props.params;
7+
8+
const { locale } = params;
9+
10+
return await getMetadata({ locale, node: council });
11+
}
12+
13+
export default async function CouncilPage() {
14+
return <MajorCategoryPageLayout theme="light" />;
15+
}

components/layout/pageLayout/MajorCategoryPageLayout.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ interface GuidePageLayoutProps {
1616
title?: string;
1717
subtitle?: string;
1818
description?: string;
19+
theme?: 'light' | 'dark';
1920
}
2021

2122
// TODO: RootItem을 클릭했을 때 LeafItem이 보이도록 자동 스크롤
2223
export default function MajorCategoryPageLayout({
2324
title,
2425
subtitle = '',
2526
description = '',
27+
theme = 'dark',
2628
}: GuidePageLayoutProps) {
2729
const t = useTranslations('Nav');
2830
const currentPage = useCurrentSegmentNode();
@@ -52,7 +54,7 @@ export default function MajorCategoryPageLayout({
5254
)}
5355
</div>
5456
<div
55-
className={`bg-neutral-900 px-5 pt-7 ${
57+
className={`${theme === 'light' ? 'bg-white' : 'bg-neutral-900'} px-5 pt-7 ${
5658
!description && 'pb-16'
5759
} sm:px-[6.25rem] sm:pb-[11.25rem] sm:pt-20`}
5860
>
@@ -65,6 +67,7 @@ export default function MajorCategoryPageLayout({
6567
subpage.isPage ? router.push(getPath(subpage)) : setSelectedCategory(subpage)
6668
}
6769
isSelected={selectedCategory == subpage}
70+
isLight={theme === 'light'}
6871
isPage={subpage.isPage}
6972
/>
7073
))}
@@ -99,15 +102,20 @@ interface RootItemProps {
99102
isPage: boolean;
100103
isSelected?: boolean;
101104
onClick: () => void;
105+
isLight?: boolean;
102106
}
103107

104-
function RootItem({ title, isPage, isSelected, onClick }: RootItemProps) {
108+
function RootItem({ title, isPage, isSelected, isLight, onClick }: RootItemProps) {
109+
const bgColor = isSelected ? 'bg-main-orange-dark' : isLight ? 'bg-neutral-50' : 'bg-neutral-100';
110+
105111
return (
106112
<DetailItem
107113
title={title}
108114
onClick={onClick}
109115
hasArrow={isPage}
110-
bgColor={isSelected ? 'bg-main-orange-dark' : 'bg-neutral-100'}
116+
bgColor={bgColor}
117+
hoverColor={isLight ? 'bg-neutral-200' : 'bg-main-orange-dark'}
118+
borderColor={isLight ? 'border-neutral-200' : undefined}
111119
/>
112120
);
113121
}
@@ -133,15 +141,23 @@ interface DetailItemProps {
133141
hasArrow: boolean;
134142
bgColor: string;
135143
hoverColor?: string;
144+
borderColor?: string;
136145
onClick: () => void;
137146
}
138147

139-
function DetailItem({ title, hasArrow, bgColor, hoverColor, onClick }: DetailItemProps) {
148+
function DetailItem({
149+
title,
150+
hasArrow,
151+
bgColor,
152+
hoverColor,
153+
borderColor,
154+
onClick,
155+
}: DetailItemProps) {
140156
const hoverBgColor = hoverColor ? `hover:${hoverColor}` : 'hover:bg-main-orange-dark';
141157

142158
return (
143159
<div
144-
className={`group h-[96px] sm:h-[160px] ${bgColor} px-[14px] py-[13px] sm:px-7 sm:py-6 ${hoverBgColor} flex cursor-pointer flex-col justify-between duration-300`}
160+
className={`group h-[96px] sm:h-[160px] ${bgColor} ${borderColor && `border ${borderColor}`} px-[14px] py-[13px] sm:px-7 sm:py-6 ${hoverBgColor} flex cursor-pointer flex-col justify-between duration-300`}
145161
onClick={onClick}
146162
>
147163
<div>

0 commit comments

Comments
 (0)