forked from SWYP-team-2th/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
라우터 구조 설정 및 기본 레이아웃 적용 (SWYP-team-2th#76)
* 라우터 설정을 위한 담당페이지 세팅 * layout: outlet setting * router setting
- Loading branch information
Showing
6 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
export default function DefaultLayout() { | ||
return ( | ||
<div className="w-full h-full mx-auto my-0 min-h-lvh border-x-[1px] desktop:w-[480px]"></div> | ||
<div className="w-full h-full mx-auto my-0 min-h-lvh border-x-[1px] desktop:w-[480px]"> | ||
<Outlet /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
export default function SubLayout() { | ||
return ( | ||
<div className="w-full h-full mx-auto my-0 min-h-lvh border-x-[1px] desktop:w-[480px]"></div> | ||
<div className="w-full h-full mx-auto my-0 min-h-lvh border-x-[1px] desktop:w-[480px]"> | ||
<Outlet /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function OnBoardingPage() { | ||
return <div>OnBoardingPage</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function PostPage() { | ||
return <div>PostPage</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createBrowserRouter } from 'react-router-dom'; | ||
import App from '@/App'; | ||
import DefaultLayout from '@/components/common/layout/DefaultLayout'; | ||
import SubLayout from '@/components/common/layout/SubLayout'; | ||
import OnBoardingPage from '@/pages/onboarding/OnBoardingPage'; | ||
import PostPage from '@/pages/post/PostPage'; | ||
|
||
export const router = createBrowserRouter([ | ||
{ | ||
element: <DefaultLayout />, | ||
children: [ | ||
{ path: '/', element: <App /> }, | ||
{ | ||
path: '/posts/:shareUrl', | ||
element: <PostPage />, | ||
}, | ||
], | ||
}, | ||
{ | ||
element: <SubLayout />, | ||
children: [{ path: '/onboarding', element: <OnBoardingPage /> }], | ||
}, | ||
]); |