diff --git a/src/feature/create-album/components/CreateComplete.tsx b/src/feature/create-album/components/CreateComplete.tsx index 419c1e5..cb924b3 100644 --- a/src/feature/create-album/components/CreateComplete.tsx +++ b/src/feature/create-album/components/CreateComplete.tsx @@ -3,6 +3,7 @@ import { CountdownTimer } from '@/global/components/CountdownTimer'; import LongButton from '@/global/components/LongButton'; import { Check } from 'lucide-react'; import { useRouter } from 'next/navigation'; +import { useCallback } from 'react'; interface CreateCompleteProps { albumId: string; @@ -11,9 +12,9 @@ interface CreateCompleteProps { export default function CreateComplete({ albumId }: CreateCompleteProps) { const router = useRouter(); - const handleClick = () => { + const handleClick = useCallback(() => { router.push(`/album/upload/${albumId}`); - }; + }, [router, albumId]); return (
diff --git a/src/global/components/CountdownTimer.tsx b/src/global/components/CountdownTimer.tsx index 14a630a..cf71214 100644 --- a/src/global/components/CountdownTimer.tsx +++ b/src/global/components/CountdownTimer.tsx @@ -1,5 +1,5 @@ 'use client'; -import { AnimatePresence, motion } from 'framer-motion'; +import { AnimatePresence, LazyMotion, domAnimation, m } from 'framer-motion'; import { useEffect, useState } from 'react'; interface TimeLeft { @@ -47,7 +47,7 @@ function AnimatedNumber({ number, label }: AnimatedNumberProps) {
- {formattedNumber} - +
@@ -114,15 +114,52 @@ export function CountdownTimer({ albumId }: CountdownTimerProps) { return () => clearInterval(timer); }, [targetDate]); + // 레이아웃 시프트 방지를 위해 초기 렌더링 시에도 공간 확보 + if (!targetDate) { + return ( +
+
+
+ + Days + +
+ : +
+
+ + HOURS + +
+ : +
+
+ + Mins + +
+ : +
+
+ + Secs + +
+
+ ); + } + return ( -
- - : - - : - - : - -
+ +
+ + : + + : + + : + +
+
); }