1- import  dynamic  from  'next/dynamic' 
21import  {  NextSeo  }  from  'next-seo' 
2+ import  dynamic  from  'next/dynamic' 
3+ import  {  useState  }  from  'react' 
34
45import  { 
56	botCategories , 
@@ -13,6 +14,7 @@ const Tag = dynamic(() => import('@components/Tag'))
1314const  Search  =  dynamic ( ( )  =>  import ( '@components/Search' ) ) 
1415
1516const  Hero : React . FC < HeroProps >  =  ( {  type =  'all' ,  header,  description } )  =>  { 
17+ 	const  [ showAllCategories ,  setShowAllCategories ]  =  useState ( false ) 
1618	const  link  =  `/${ type }  /categories` 
1719	return  ( 
1820		< > 
@@ -110,32 +112,36 @@ const Hero: React.FC<HeroProps> = ({ type = 'all', header, description }) => {
110112									bigger 
111113									href = { type  ===  'bots'  ? '/bots/list/votes'  : '/servers/list/votes' } 
112114								/> 
113- 								{ ( type  ===  'bots'  ? botCategories  : serverCategories ) . slice ( 0 ,  4 ) . map ( ( t )  =>  ( 
114- 									< Tag 
115- 										key = { t } 
116- 										text = { 
117- 											< > 
118- 												< i 
119- 													className = { ( type  ===  'bots'  ? botCategoryIcon  : serverCategoryIcon ) [ t ] } 
120- 												/> { ' ' } 
121- 												{ t } 
122- 											</ > 
123- 										} 
124- 										dark 
125- 										bigger 
126- 										href = { `${ link }  /${ t }  ` } 
127- 									/> 
128- 								) ) } 
115+ 								{ ( type  ===  'bots'  ? botCategories  : serverCategories ) 
116+ 									. slice ( 0 ,  showAllCategories  ? undefined  : 4 ) 
117+ 									. map ( ( t )  =>  ( 
118+ 										< Tag 
119+ 											key = { t } 
120+ 											text = { 
121+ 												< > 
122+ 													< i 
123+ 														className = { ( type  ===  'bots'  ? botCategoryIcon  : serverCategoryIcon ) [ t ] } 
124+ 													/> { ' ' } 
125+ 													{ t } 
126+ 												</ > 
127+ 											} 
128+ 											dark 
129+ 											bigger 
130+ 											href = { `${ link }  /${ t }  ` } 
131+ 										/> 
132+ 									) ) } 
129133								< Tag 
130134									key = 'tag' 
135+ 									className = 'cursor-pointer' 
131136									text = { 
132137										< > 
133- 											< i  className = 'fas fa-tag'  />  카테고리 더보기
138+ 											< i  className = 'fas fa-tag'  /> { ' ' } 
139+ 											{ showAllCategories  ? '간략히 보기'  : '카테고리 더보기' } 
134140										</ > 
135141									} 
136142									dark 
137143									bigger 
138- 									href = { link } 
144+ 									onClick = { ( )   =>   setShowAllCategories ( ! showAllCategories ) } 
139145								/> 
140146							</ > 
141147						) } 
0 commit comments