@@ -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이 보이도록 자동 스크롤
2223export 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