From 7a1884c4b2d3aece5d19ff6d88ed2b2fa9585a3e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Nov 2024 15:07:31 +0900 Subject: [PATCH] =?UTF-8?q?HotFix:=20=EB=A3=A8=ED=8A=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/routes/path.ts | 1 + src/app/routes/router.tsx | 16 +++++++++++++++- src/pages/common/index.ts | 1 + src/pages/common/onboard/ui/OnboardPage.tsx | 2 -- src/pages/common/root/RootPage.tsx | 7 +++++++ src/pages/common/root/index.ts | 1 + 6 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/pages/common/root/RootPage.tsx create mode 100644 src/pages/common/root/index.ts diff --git a/src/app/routes/path.ts b/src/app/routes/path.ts index f8ce4d65..b3aa681e 100644 --- a/src/app/routes/path.ts +++ b/src/app/routes/path.ts @@ -1,5 +1,6 @@ export const RouterPath = { ROOT: '/', + ONBOARD: 'onboard', LOGIN: 'login', SIGNUP: 'signup', REGISTER: 'register', diff --git a/src/app/routes/router.tsx b/src/app/routes/router.tsx index 802f8aee..3337f88b 100644 --- a/src/app/routes/router.tsx +++ b/src/app/routes/router.tsx @@ -3,7 +3,12 @@ import { createBrowserRouter, RouterProvider } from 'react-router-dom'; import { ProtectedRoute } from './components'; import { RouterPath } from './path'; -import { OnboardPage, RedirectPage, DummyRedirectPage } from '@/pages'; +import { + OnboardPage, + RedirectPage, + DummyRedirectPage, + RootPage, +} from '@/pages'; import { Layout, LoadingView } from '@/shared/components'; export const RegisterPage = lazy( @@ -128,6 +133,15 @@ export const router = createBrowserRouter([ children: [ { path: '', + children: [ + { + index: true, + element: , + }, + ], + }, + { + path: RouterPath.ONBOARD, children: [ { index: true, diff --git a/src/pages/common/index.ts b/src/pages/common/index.ts index 7ccecf97..1db06609 100644 --- a/src/pages/common/index.ts +++ b/src/pages/common/index.ts @@ -3,3 +3,4 @@ export * from './onboard'; export * from './redirect'; export * from './register'; export * from './service-manual'; +export * from './root'; diff --git a/src/pages/common/onboard/ui/OnboardPage.tsx b/src/pages/common/onboard/ui/OnboardPage.tsx index 70bc45eb..14b6b082 100644 --- a/src/pages/common/onboard/ui/OnboardPage.tsx +++ b/src/pages/common/onboard/ui/OnboardPage.tsx @@ -17,8 +17,6 @@ export const OnboardPage = () => { setPage(swiper.activeIndex); }; - if (window.location.pathname !== '/') return null; - return ( diff --git a/src/pages/common/root/RootPage.tsx b/src/pages/common/root/RootPage.tsx new file mode 100644 index 00000000..7c5f9778 --- /dev/null +++ b/src/pages/common/root/RootPage.tsx @@ -0,0 +1,7 @@ +import { Navigate } from 'react-router-dom'; + +export const RootPage = () => { + if (window.location.pathname !== '/') return null; + + return ; +}; diff --git a/src/pages/common/root/index.ts b/src/pages/common/root/index.ts new file mode 100644 index 00000000..dab2aef4 --- /dev/null +++ b/src/pages/common/root/index.ts @@ -0,0 +1 @@ +export { RootPage } from './RootPage';