From ac78d3efed23b73220ce8bebac3e8bc6a506fe42 Mon Sep 17 00:00:00 2001 From: JongHyun Date: Mon, 5 Aug 2024 01:58:04 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EA=B2=BD=EB=A1=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CreateDiaryModal.jsx | 20 +++++-------------- .../components/DiaryPostModal.jsx | 2 +- src/diaryWritePage/components/DiaryWrite.jsx | 7 ++----- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/diaryListPage/components/CreateDiaryModal.jsx b/src/diaryListPage/components/CreateDiaryModal.jsx index 5ac00ed..c5170fe 100644 --- a/src/diaryListPage/components/CreateDiaryModal.jsx +++ b/src/diaryListPage/components/CreateDiaryModal.jsx @@ -25,27 +25,17 @@ function CreateDiaryModal({ setIsModalOpen, goalId }) { ๐Ÿ‘พ steppy์™€ ํ•จ๊ป˜ ์ผ์ง€ ์ž‘์„ฑํ•˜๊ธฐ -
- ๋ฌด์Šจ ์ผ์ง€๋ฅผ ์จ์•ผํ• ์ง€ ๊ณ ๋ฏผ์ด ๋˜๋Š” ๋‚ ์—๋„, ๊ณ ๋œ ์ผ์ •์œผ๋กœ - ํ”ผ๊ณคํ•œ ํ•˜๋ฃจ์—๋„ -
-
- steppy๊ฐ€ chicky๋‹˜์˜ ๊พธ์ค€ํ•œ ๊ธฐ๋ก์„ ๋„์™€์ค„๊ฒŒ์š”! -
+
๋ฌด์Šจ ์ผ์ง€๋ฅผ ์จ์•ผํ• ์ง€ ๊ณ ๋ฏผ์ด ๋˜๋Š” ๋‚ ์—๋„, ๊ณ ๋œ ์ผ์ •์œผ๋กœ ํ”ผ๊ณคํ•œ ํ•˜๋ฃจ์—๋„
+
steppy๊ฐ€ chicky๋‹˜์˜ ๊พธ์ค€ํ•œ ๊ธฐ๋ก์„ ๋„์™€์ค„๊ฒŒ์š”!
- navigate(`/write?id=${goalId}`)}> + navigate(`/write`, { state: { goalId } })}> โœ๏ธ ์ง์ ‘ ์ž‘์„ฑํ•˜๊ธฐ -
- ์˜ค๋Š˜๋งŒํผ์€ ์ ๊ณ  ์‹ถ์€๊ฒŒ ๋„ˆ๋ฌด ๋งŽ์€ ๋‚ , ๋– ์˜ค๋ฅด๋Š” ์ƒ๊ฐ๊ณผ ๋Š๋‚Œ์„ - ์ ๊ณ  ์‹ถ์€ ๋‚  -
-
- ์ž์œ ๋กญ๊ฒŒ ํ•˜๋ฃจ์˜ ์ผ์ง€๋ฅผ ์ ์–ด๋ณด์•„์š”! -
+
์˜ค๋Š˜๋งŒํผ์€ ์ ๊ณ  ์‹ถ์€๊ฒŒ ๋„ˆ๋ฌด ๋งŽ์€ ๋‚ , ๋– ์˜ค๋ฅด๋Š” ์ƒ๊ฐ๊ณผ ๋Š๋‚Œ์„ ์ ๊ณ  ์‹ถ์€ ๋‚ 
+
์ž์œ ๋กญ๊ฒŒ ํ•˜๋ฃจ์˜ ์ผ์ง€๋ฅผ ์ ์–ด๋ณด์•„์š”!
diff --git a/src/diaryWritePage/components/DiaryPostModal.jsx b/src/diaryWritePage/components/DiaryPostModal.jsx index 823e9ba..e7e23a2 100644 --- a/src/diaryWritePage/components/DiaryPostModal.jsx +++ b/src/diaryWritePage/components/DiaryPostModal.jsx @@ -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 ( diff --git a/src/diaryWritePage/components/DiaryWrite.jsx b/src/diaryWritePage/components/DiaryWrite.jsx index 8c6637b..1fb3f4a 100644 --- a/src/diaryWritePage/components/DiaryWrite.jsx +++ b/src/diaryWritePage/components/DiaryWrite.jsx @@ -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); @@ -69,9 +68,7 @@ function DiaryWrite() { csrfToken={csrfToken} /> )} - {!thumbnailModal && postedModal && ( - - )} + {!thumbnailModal && postedModal && } );