Skip to content

Commit

Permalink
feat: 글쓰기 버튼 로그인 될 때만 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
eunbeann committed Jan 18, 2024
1 parent cedf9f8 commit f85b0f4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Detail/components/LecueNoteListContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,16 @@ function LecueNoteListContainer(props: LecueNoteListContainerProps) {
};

const handleClickWriteButton = () => {
navigate(`/create-note/${bookUuid}`, {
state: { bookId: bookId },
});
if (
localStorage.getItem('token') &&
localStorage.getItem('token') !== null
) {
navigate(`/create-note/${bookUuid}`, {
state: { bookId: bookId },
});
} else {
setModalOn(true);
}
};

useEffect(() => {
Expand Down

0 comments on commit f85b0f4

Please sign in to comment.