@@ -181,91 +181,95 @@ function Mission() {
181181 } ) ;
182182
183183 return (
184- < div className = "flex flex-col" >
185- < div className = "flex justify-between sticky top-[78px] items-center px-4 bg-neutral-500 pb-4" >
186- < div id = "mission-filters" className = "flex gap-2" >
187- { ( [ "all" , "not_tried" , "failed" , "success" ] as const ) . map ( ( type ) => (
184+ < >
185+ < div className = "flex flex-col" >
186+ < div className = "flex justify-between sticky top-[78px] items-center px-4 bg-neutral-500 pb-4" >
187+ < div id = "mission-filters" className = "flex gap-2" >
188+ { ( [ "all" , "not_tried" , "failed" , "success" ] as const ) . map (
189+ ( type ) => (
190+ < button
191+ key = { type }
192+ type = "button"
193+ disabled = { ! isSessionStarted }
194+ className = { cn (
195+ "h-9 px-4 rounded-3xl whitespace-nowrap t-p-14-m transition-colors text-neutral-100" ,
196+ cn ( {
197+ "bg-neutral-600" : filter === type && isSessionStarted ,
198+ } )
199+ ) }
200+ onClick = { ( ) => {
201+ setFilter ( type ) ;
202+ scrollTo ( 0 ) ;
203+ } }
204+ >
205+ { getFilterLabels ( recommendations , filter ) [ type ] }
206+ </ button >
207+ )
208+ ) }
209+ </ div >
210+ { isSessionStarted && (
188211 < button
189- key = { type }
212+ id = "mission-view-toggle"
190213 type = "button"
191- disabled = { ! isSessionStarted }
192- className = { cn (
193- "h-9 px-4 rounded-3xl whitespace-nowrap t-p-14-m transition-colors text-neutral-100" ,
194- cn ( {
195- "bg-neutral-600" : filter === type && isSessionStarted ,
196- } )
197- ) }
198- onClick = { ( ) => {
199- setFilter ( type ) ;
200- scrollTo ( 0 ) ;
201- } }
214+ className = "w-6 h-6 text-neutral-100"
215+ onClick = { toggleViewMode }
216+ aria-label = { viewMode === "card" ? "목록으로 보기" : "카드로 보기" }
202217 >
203- { getFilterLabels ( recommendations , filter ) [ type ] }
218+ { viewMode === "card" ? (
219+ < ListIcon variant = "white" />
220+ ) : (
221+ < GridIcon variant = "white" />
222+ ) }
204223 </ button >
205- ) ) }
224+ ) }
206225 </ div >
207- { isSessionStarted && (
208- < button
209- id = "mission-view-toggle"
210- type = "button"
211- className = "w-6 h-6 text-neutral-100"
212- onClick = { toggleViewMode }
213- aria-label = { viewMode === "card" ? "목록으로 보기" : "카드로 보기" }
214- >
215- { viewMode === "card" ? (
216- < ListIcon variant = "white" />
217- ) : (
218- < GridIcon variant = "white" />
219- ) }
220- </ button >
221- ) }
222- </ div >
223226
224- { viewMode === "card" ? (
225- < div id = "mission-carousel" className = "overflow-hidden" ref = { emblaRef } >
226- < div className = "flex items-center p-2 pb-4" >
227- { isSessionStarted ? (
228- filteredRecommendations . length > 0 ? (
229- filteredRecommendations . map ( ( mission , index ) => (
230- < MissionGridCard
231- key = { mission . missionId }
232- { ...createMissionCardProps ( mission ) }
233- type = "main"
234- isSelected = { index === selectedIndex }
227+ { viewMode === "card" ? (
228+ < div id = "mission-carousel" className = "overflow-hidden" ref = { emblaRef } >
229+ < div className = "flex items-center p-2 pb-4" >
230+ { isSessionStarted ? (
231+ filteredRecommendations . length > 0 ? (
232+ filteredRecommendations . map ( ( mission , index ) => (
233+ < MissionGridCard
234+ key = { mission . missionId }
235+ { ...createMissionCardProps ( mission ) }
236+ type = "main"
237+ isSelected = { index === selectedIndex }
238+ />
239+ ) )
240+ ) : (
241+ < MissionEmpty
242+ status = { filter as "success" | "failed" | "not_tried" }
243+ onClickRecommend = { ( ) => setFilter ( "not_tried" ) }
235244 />
236- ) )
245+ )
237246 ) : (
238- < MissionEmpty
239- status = { filter as "success" | "failed" | "not_tried" }
240- onClickRecommend = { ( ) => setFilter ( "not_tried" ) }
247+ < MissionLockCard />
248+ ) }
249+ </ div >
250+ </ div >
251+ ) : (
252+ < div id = "mission-list" className = "flex flex-col gap-2 px-4 pb-[88px]" >
253+ { filteredRecommendations . length > 0 ? (
254+ filteredRecommendations . map ( ( mission ) => (
255+ < MissionListCard
256+ key = { mission . missionId }
257+ { ...createMissionCardProps ( mission ) }
241258 />
242- )
259+ ) )
243260 ) : (
244- < MissionLockCard />
261+ < MissionEmpty
262+ status = { filter as "success" | "failed" | "not_tried" }
263+ onClickRecommend = { ( ) => setFilter ( "not_tried" ) }
264+ />
245265 ) }
246266 </ div >
247- </ div >
248- ) : (
249- < div id = "mission-list" className = "flex flex-col gap-2 px-4" >
250- { filteredRecommendations . length > 0 ? (
251- filteredRecommendations . map ( ( mission ) => (
252- < MissionListCard
253- key = { mission . missionId }
254- { ...createMissionCardProps ( mission ) }
255- />
256- ) )
257- ) : (
258- < MissionEmpty
259- status = { filter as "success" | "failed" | "not_tried" }
260- onClickRecommend = { ( ) => setFilter ( "not_tried" ) }
261- />
262- ) }
263- </ div >
264- ) }
267+ ) }
268+ </ div >
265269 < MissionTimer
266270 showMockStopButton = { showMockStopButton }
267271 isTooltipOpen = { ! isSessionStarted }
268272 />
269- </ div >
273+ </ >
270274 ) ;
271275}
0 commit comments