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() { /> - + ) }