We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const { user } = useAuthContext(); const isLoggedIn = !!user;
isLoggedIn 분기를 사용하기 위해 useAuthContext를 호출하는 것을 조금 더 심플하고 하나의 훅에서 관리할 수 있도록 커스텀 훅을 만든다.
const { user } = useAuthContext(); const isLoggedIn = !!user; return { {isLoggedIn ? ( <> <Avatar src={shookshook} alt="슉슉이" /> <Input type="text" disabled={isPendingPostComment} value={newComment} onChange={changeNewComment} placeholder="댓글 추가..." maxLength={200} /> </> ) : ( <> <Avatar src={defaultAvatar} alt="익명 프로필" /> <Input type="text" onFocus={openLoginModal} placeholder="댓글 추가..." disabled={isLoginModalOpen} /> </> )} }
return { <AuthConditional loggedin={ <> <Avatar src={shookshook} alt="슉슉이" /> <Input type="text" disabled={isPendingPostComment} value={newComment} onChange={changeNewComment} placeholder="댓글 추가..." maxLength={200} /> </> } guest={ <> <Avatar src={defaultAvatar} alt="익명 프로필" /> <Input type="text" onFocus={openLoginModal} placeholder="댓글 추가..." disabled={isLoginModalOpen} /> </> } /> }
The text was updated successfully, but these errors were encountered:
cruelladevil
No branches or pull requests
🤷 개선할 기능
isLoggedIn 분기를 사용하기 위해 useAuthContext를 호출하는 것을
조금 더 심플하고 하나의 훅에서 관리할 수 있도록 커스텀 훅을 만든다.
🔨 상세 작업 내용
📄 참고 사항
as-is
to-be
The text was updated successfully, but these errors were encountered: