diff --git a/src/app/routes/path.ts b/src/app/routes/path.ts index f8ce4d6..b3aa681 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 802f8ae..3337f88 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 7ccecf9..1db0660 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 70bc45e..14b6b08 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 0000000..7c5f977 --- /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 0000000..dab2aef --- /dev/null +++ b/src/pages/common/root/index.ts @@ -0,0 +1 @@ +export { RootPage } from './RootPage';