From c4993b3eff80c097cd89302c5fd894d95bc3eb99 Mon Sep 17 00:00:00 2001 From: lsy20140 Date: Tue, 8 Oct 2024 18:00:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20LoginBottomSheet=20type=20=EC=B6=A9?= =?UTF-8?q?=EB=8F=8C=20=EB=AC=B8=EC=A0=9C=20type=20state=EB=A1=9C=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=ED=95=98=EC=97=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/home/learning/TodayQuiz/index.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/domain/home/learning/TodayQuiz/index.tsx b/src/components/domain/home/learning/TodayQuiz/index.tsx index 9308bc49..28a1afba 100644 --- a/src/components/domain/home/learning/TodayQuiz/index.tsx +++ b/src/components/domain/home/learning/TodayQuiz/index.tsx @@ -15,18 +15,23 @@ export default function TodayQuiz() { const { bottomSheetType, openBottomSheet } = useUIStore() const router = useRouter() const [skipLogin, setSkipLogin] = useState(null) + const [loginSheetType, setLoginSheetType] = useState< + 'loginBtn' | 'learningTab' + >('loginBtn') useEffect(() => { if (typeof window === undefined) return setSkipLogin(localStorage.getItem('skipLogin')) if (!userId && skipLogin === 'false') { openBottomSheet('login') + setLoginSheetType('learningTab') } - }, [userId, openBottomSheet, skipLogin]) + }, [skipLogin, openBottomSheet, userId]) const handleClick = () => { if (!userId) { openBottomSheet('login') + setLoginSheetType('loginBtn') return } router.push('/') // quiz url로 변경 @@ -66,7 +71,10 @@ export default function TodayQuiz() { /> - + ) }