11import { useEffect , useState } from "react" ;
22import { useQuery } from "@tanstack/react-query" ;
3- import GNB from "@/shared/layouts/gnb" ;
3+ import GrobalNavigationBar from "@/shared/layouts/gnb" ;
44import FlipCard from "@/shared/components/flip-card" ;
55import {
66 Carousel ,
@@ -28,12 +28,36 @@ import { cardApi, type CardResponse } from "@/shared/apis/card";
2828// [DEV_MOCK] UI 작업용 임시 목 데이터 - 작업 완료 후 제거
2929const DEV_MOCK = true ;
3030const MOCK_CARDS : CardResponse [ ] = [
31- { id : "1" , question : "React에서 상태 관리를 위한 기본 훅은 무엇인가?" , answer : "useState" } ,
32- { id : "2" , question : "컴포넌트의 사이드 이펙트를 처리하는 훅은 무엇인가?" , answer : "useEffect" } ,
33- { id : "3" , question : "컨텍스트 값을 구독할 때 사용하는 훅은 무엇인가?" , answer : "useContext" } ,
34- { id : "4" , question : "이전 렌더링 값을 기억할 때 사용하는 훅은 무엇인가?" , answer : "useRef" } ,
35- { id : "5" , question : "비용이 큰 계산 결과를 메모이제이션할 때 사용하는 훅은?" , answer : "useMemo" } ,
36- { id : "6" , question : "함수를 메모이제이션할 때 사용하는 훅은?" , answer : "useCallback" } ,
31+ {
32+ id : "1" ,
33+ question : "React에서 상태 관리를 위한 기본 훅은 무엇인가?" ,
34+ answer : "useState" ,
35+ } ,
36+ {
37+ id : "2" ,
38+ question : "컴포넌트의 사이드 이펙트를 처리하는 훅은 무엇인가?" ,
39+ answer : "useEffect" ,
40+ } ,
41+ {
42+ id : "3" ,
43+ question : "컨텍스트 값을 구독할 때 사용하는 훅은 무엇인가?" ,
44+ answer : "useContext" ,
45+ } ,
46+ {
47+ id : "4" ,
48+ question : "이전 렌더링 값을 기억할 때 사용하는 훅은 무엇인가?" ,
49+ answer : "useRef" ,
50+ } ,
51+ {
52+ id : "5" ,
53+ question : "비용이 큰 계산 결과를 메모이제이션할 때 사용하는 훅은?" ,
54+ answer : "useMemo" ,
55+ } ,
56+ {
57+ id : "6" ,
58+ question : "함수를 메모이제이션할 때 사용하는 훅은?" ,
59+ answer : "useCallback" ,
60+ } ,
3761] ;
3862
3963type MemoizeControllerProps = {
@@ -166,7 +190,7 @@ const MemoizeController = ({
166190 onChange = { ( e ) =>
167191 setSettings ( ( prev ) => ( {
168192 ...prev ,
169- autoTimerSeconds : parseInt ( e . target . value ) || 5 ,
193+ autoTimerSeconds : Number . parseInt ( e . target . value ) || 5 ,
170194 } ) )
171195 }
172196 className = "w-16 text-center"
@@ -179,7 +203,6 @@ const MemoizeController = ({
179203 ) ;
180204} ;
181205
182-
183206type CardCarouselProps = {
184207 cards : CardResponse [ ] ;
185208 api : CarouselApi ;
@@ -222,11 +245,9 @@ const CardCarousel = ({
222245 } else {
223246 api . scrollNext ( ) ;
224247 }
225- } else {
248+ } else if ( api . canScrollNext ( ) ) {
226249 // 마지막 슬라이드면 멈춤
227- if ( api . canScrollNext ( ) ) {
228- api . scrollNext ( ) ;
229- }
250+ api . scrollNext ( ) ;
230251 }
231252 } , duration ) ;
232253
@@ -321,7 +342,7 @@ const MemoizeMode = ({ settings: studySettings }: MemoizeModeProps) => {
321342 if ( isLoading ) {
322343 return (
323344 < div className = "h-dvh flex flex-col overflow-hidden" >
324- < GNB />
345+ < GrobalNavigationBar />
325346 < div className = "flex-1 flex items-center justify-center" >
326347 < Loader2 className = "h-8 w-8 animate-spin text-gray-500" />
327348 </ div >
@@ -332,7 +353,7 @@ const MemoizeMode = ({ settings: studySettings }: MemoizeModeProps) => {
332353 if ( isError || cards . length === 0 ) {
333354 return (
334355 < div className = "h-dvh flex flex-col overflow-hidden" >
335- < GNB />
356+ < GrobalNavigationBar />
336357 < div className = "flex-1 flex items-center justify-center" >
337358 < p className = "text-gray-500" > 카드를 불러올 수 없습니다.</ p >
338359 </ div >
@@ -342,7 +363,7 @@ const MemoizeMode = ({ settings: studySettings }: MemoizeModeProps) => {
342363
343364 return (
344365 < div className = "h-dvh flex flex-col overflow-hidden" >
345- < GNB />
366+ < GrobalNavigationBar />
346367 < div className = "flex-1 min-h-0 flex items-center justify-center px-4 pb-32" >
347368 < CardCarousel
348369 cards = { cards }
0 commit comments