Skip to content

Commit

Permalink
fix : 경로 설정 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JongHyun authored and JongHyun committed Aug 4, 2024
1 parent 34c0488 commit ac78d3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
20 changes: 5 additions & 15 deletions src/diaryListPage/components/CreateDiaryModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,17 @@ function CreateDiaryModal({ setIsModalOpen, goalId }) {
<TextContainer>
<MainText>👾 steppy와 함께 일지 작성하기</MainText>
<SubText>
<div>
무슨 일지를 써야할지 고민이 되는 날에도, 고된 일정으로
피곤한 하루에도
</div>
<div style={{ marginTop: "3px" }}>
steppy가 chicky님의 꾸준한 기록을 도와줄게요!
</div>
<div>무슨 일지를 써야할지 고민이 되는 날에도, 고된 일정으로 피곤한 하루에도</div>
<div style={{ marginTop: "3px" }}>steppy가 chicky님의 꾸준한 기록을 도와줄게요!</div>
</SubText>
</TextContainer>
</WriteMethod>
<WriteMethod onClick={() => navigate(`/write?id=${goalId}`)}>
<WriteMethod onClick={() => navigate(`/write`, { state: { goalId } })}>
<TextContainer>
<MainText>✍️ 직접 작성하기</MainText>
<SubText>
<div>
오늘만큼은 적고 싶은게 너무 많은 날, 떠오르는 생각과 느낌을
적고 싶은 날
</div>
<div style={{ marginTop: "3px" }}>
자유롭게 하루의 일지를 적어보아요!
</div>
<div>오늘만큼은 적고 싶은게 너무 많은 날, 떠오르는 생각과 느낌을 적고 싶은 날</div>
<div style={{ marginTop: "3px" }}>자유롭게 하루의 일지를 적어보아요!</div>
</SubText>
</TextContainer>
</WriteMethod>
Expand Down
2 changes: 1 addition & 1 deletion src/diaryWritePage/components/DiaryPostModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function DiaryPostModal({ setPostedModal, goalId }) {
const navigate = useNavigate();
const closeModal = () => {
setPostedModal(false);
navigate(`/diaryList?id=${goalId}`); // !!!! 중요, 나중에 연결할때 이 부분이 diaryList?id= 링크로 연결되어야함.
navigate(`/diaryList`, { state: { goalId } }); // !!!! 중요, 나중에 연결할때 이 부분이 diaryList?id= 링크로 연결되어야함.
};

return (
Expand Down
7 changes: 2 additions & 5 deletions src/diaryWritePage/components/DiaryWrite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function DiaryWrite() {
});
const csrfToken = useRecoilValue(tokenState);
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const goalId = queryParams.get("id");
const goalId = location.state.goalId;

const openThumbnailModal = () => {
setThumbnailModal(true);
Expand Down Expand Up @@ -69,9 +68,7 @@ function DiaryWrite() {
csrfToken={csrfToken}
/>
)}
{!thumbnailModal && postedModal && (
<DiaryPostModal setPostedModal={setPostedModal} goalId={goalId} />
)}
{!thumbnailModal && postedModal && <DiaryPostModal setPostedModal={setPostedModal} goalId={goalId} />}
</BoxWrapper>
</Wrapper>
);
Expand Down

0 comments on commit ac78d3e

Please sign in to comment.