diff --git a/frontend/src/router.tsx b/frontend/src/router.tsx index 4ae819044..7f5833bd5 100644 --- a/frontend/src/router.tsx +++ b/frontend/src/router.tsx @@ -1,7 +1,8 @@ +import { Suspense, lazy } from 'react'; import { createBrowserRouter } from 'react-router-dom'; import Home from './pages/Home'; import RootPage from './pages/RootPage'; -import { ReactNode, lazy } from 'react'; +import { ReactNode } from 'react'; import AuthLayout from './components/Layout/AuthLayout'; import NotFound from './pages/NotFound'; @@ -26,6 +27,14 @@ interface routeElement { children: { path: string; element: ReactNode; withAuth: boolean }[]; } +interface SuspenseCompProps { + children: ReactNode; +} + +const SuspenseComp = ({ children }: SuspenseCompProps) => { + return {children}; +}; + const routes: routeElement[] = [ { path: '/', @@ -41,57 +50,101 @@ const routes: routeElement[] = [ }, { path: 'topics/:topicId', - element: , + element: ( + + + + ), withAuth: false, }, { path: 'new-topic', - element: , + element: ( + + + + ), withAuth: true, }, { path: 'new-pin', - element: , + element: ( + + + + ), withAuth: true, }, { path: 'see-all/popularity', - element: , + element: ( + + + + ), withAuth: false, }, { path: 'see-all/near', - element: , + element: ( + + + + ), withAuth: false, }, { path: 'see-all/latest', - element: , + element: ( + + + + ), withAuth: false, }, { path: 'see-together', - element: , + element: ( + + + + ), withAuth: true, }, { path: 'favorite', - element: , + element: ( + + + + ), withAuth: true, }, { path: 'my-page', - element: , + element: ( + + + + ), withAuth: true, }, { path: '/askLogin', - element: , + element: ( + + + + ), withAuth: false, }, { path: '/oauth/redirected/kakao', - element: , + element: ( + + + + ), withAuth: false, }, ],