From b2ceeadcef3ed86bfbda79528fd472c7efc7e813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=98=81=EA=B8=B8/KIM=20YOUNG=20GIL?= <80146176+Gilpop8663@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:52:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=9D=B4=EB=93=9C=EB=B0=94=EC=97=90?= =?UTF-8?q?=20=ED=86=A0=EC=8A=A4=ED=8A=B8=EA=B0=80=20=EA=B0=80=EB=A0=A4?= =?UTF-8?q?=EC=A7=80=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?(feat.createPortal)=20=20(#841)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: (#738) createPortal을 이용하여 Drawer가 켜졌을 때와 닫힐 때 토스트가 생성될 위치를 변경 Drawer가 켜진다면 dialog 태그 내에서 생성되고, 닫히거나 열리지 않았다면 toast-content라는 별개의 div에서 생성되도록 구현 * style: 모바일에서 토스트가 중앙으로 오도록 스타일 변경 * feat: (#738) 토스트를 보여주는 엘리먼트 아이디가 중복되어서 각각 설정하도록 useDialog, Dialog 코드 변경 * refactor: (#738) 없어도 무방한 async/await 코드 삭제 및 주석되어 있던 코드 복구 * chore: (#738) 모킹 데이터로 실험하던 코드 복구 * refactor: (#738) Drawer와 Toast의 연관 관계가 없도록 변경 --- frontend/public/index.html | 1 + .../src/components/ToastContainer/style.ts | 7 +++-- .../Drawer/DrawerToastWrapper/index.tsx | 14 +++++++++ .../common/Drawer/DrawerToastWrapper/style.ts | 8 +++++ .../src/components/common/Drawer/index.tsx | 8 +---- frontend/src/hooks/context/toast.tsx | 31 +++++++++++++------ .../src/hooks/query/alarm/useReadAlarm.ts | 2 +- .../src/hooks/query/report/useReportAction.ts | 3 +- .../hooks/query/report/useReportContent.ts | 2 +- .../hooks/query/useReportApproveResult.tsx | 10 +++--- .../hooks/query/user/useReadLatestAlarm.ts | 2 +- .../src/hooks/query/user/useUpdateUserInfo.ts | 2 +- .../query/user/useWithdrawalMembership.ts | 2 +- frontend/src/hooks/useDrawer.tsx | 2 +- frontend/src/pages/HomePage/index.tsx | 28 ++++++++++++++--- frontend/src/types/toast.ts | 6 ++++ 16 files changed, 92 insertions(+), 36 deletions(-) create mode 100644 frontend/src/components/common/Drawer/DrawerToastWrapper/index.tsx create mode 100644 frontend/src/components/common/Drawer/DrawerToastWrapper/style.ts create mode 100644 frontend/src/types/toast.ts diff --git a/frontend/public/index.html b/frontend/public/index.html index 52646e723..b469e19bc 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -54,5 +54,6 @@
+