From 92fd417b14bf6dfee0491f9e6ba695a93a0ae230 Mon Sep 17 00:00:00 2001 From: Giwon Date: Wed, 6 Nov 2024 23:48:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?hotfix:=20=EA=B6=8C=ED=95=9C=20=EB=AF=B8?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20=EC=8B=9C=20=EB=A3=A8=ED=8A=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layouts/DashboardLayout.jsx | 55 ++++++++++------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/src/components/layouts/DashboardLayout.jsx b/src/components/layouts/DashboardLayout.jsx index a3b1a93..f5663fc 100644 --- a/src/components/layouts/DashboardLayout.jsx +++ b/src/components/layouts/DashboardLayout.jsx @@ -7,10 +7,8 @@ import PropTypes from 'prop-types'; import { API } from '@/utils/api'; import useLoading from '@/hooks/modal/useLoading'; -import useAlert from '@/hooks/modal/useAlert'; import { DashboardNav } from '@components/navigation/DashboardNav'; -import { Text } from '@components/typograph/Text'; import { Alert } from '@components/forms/modal/Alert'; import { Confirm } from '@components/forms/modal/Confirm'; import { Loading } from '@components/forms/modal/Loading'; @@ -68,7 +66,6 @@ export const DashboardLayout = ({ location }) => { // 레이아웃단에서 관리자 권한을 체크합니다. const { showLoading, hideLoading } = useLoading(); - const { openAlert } = useAlert(); // api/admin으로 권한 체크 const { isLoading, isError } = useQuery('dashboard-protection', async () => { @@ -84,13 +81,7 @@ export const DashboardLayout = ({ location }) => { } if (isError) { - openAlert({ - title: '대시보드 권한이 없습니다.', - content: 루트 페이지로 이동합니다., - onClose: () => { - navigate('/'); - }, - }); + navigate('/'); } }, [isLoading, isError]); @@ -99,26 +90,30 @@ export const DashboardLayout = ({ location }) => { - {/* 내비바 */} - - {/* 콘텐츠 */} - - {/* location.key로 랜덤한 index를 부여하여 화면 전환 시 컴포넌트 충돌이 없도록 예방합니다. */} - -
- {/* 전환 후 표시될 컴포넌트 */} - {currentOutlet} -
-
-
+ {!isLoading && ( + <> + {/* 내비바 */} + + {/* 콘텐츠 */} + + {/* location.key로 랜덤한 index를 부여하여 화면 전환 시 컴포넌트 충돌이 없도록 예방합니다. */} + +
+ {/* 전환 후 표시될 컴포넌트 */} + {currentOutlet} +
+
+
+ + )} ); }; From ae9b4b4a861de53a894c6a2a045063207325ec80 Mon Sep 17 00:00:00 2001 From: Giwon Date: Wed, 6 Nov 2024 23:52:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=EA=B6=8C=ED=95=9C=20=EB=AF=B8?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20=EC=8B=9C=20=EC=9D=B4=EC=A0=84=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layouts/DashboardLayout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layouts/DashboardLayout.jsx b/src/components/layouts/DashboardLayout.jsx index f5663fc..0730abc 100644 --- a/src/components/layouts/DashboardLayout.jsx +++ b/src/components/layouts/DashboardLayout.jsx @@ -81,7 +81,7 @@ export const DashboardLayout = ({ location }) => { } if (isError) { - navigate('/'); + navigate(-1); } }, [isLoading, isError]);