-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] - react-router-dom 설정 (#71)
* chore: react-router-dom 세팅 * chore: createBrowserRouter 적용 * chore: @Constants path alias 추가 * feat: AppLayout 컴포넌트 추가 1. TravelogueDetailPage 내 margin-top 제거 2. AppLayout 컴포넌트 구현 * feat: router path 관련 상수 추가 * refactor: router 세팅 변경 1. App 내 router router.tsx로 이동 2. router.tsx 내 AppLayout 추가 및 router path 설정 * chore: storybook-addon-remix-react-router 의존성 추가 * chore: storybook 내 router addon 설정 추가 --------- Co-authored-by: 손진영 <sm099@naver.com>
- Loading branch information
1 parent
5a5ec69
commit 5a43f26
Showing
17 changed files
with
200 additions
and
185 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import TravelogueDetailPage from "@components/pages/travelogueDetail/TravelogueDetailPage"; | ||
import { RouterProvider } from "react-router-dom"; | ||
|
||
import { router } from "./router"; | ||
|
||
const App = () => { | ||
return <TravelogueDetailPage />; | ||
return <RouterProvider router={router} />; | ||
}; | ||
|
||
export default App; |
26 changes: 0 additions & 26 deletions
26
frontend/src/components/common/TransformBottomSheet/TransformBottomSheet.stories.tsx
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const OutletContainer = styled.main` | ||
padding-top: 5.7rem; | ||
`; |
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,18 @@ | ||
import { Outlet } from "react-router-dom"; | ||
|
||
import { Header } from "@components/common"; | ||
|
||
import * as S from "./AppLayout.styled"; | ||
|
||
const AppLayout = () => { | ||
return ( | ||
<> | ||
<Header /> | ||
<S.OutletContainer> | ||
<Outlet /> | ||
</S.OutletContainer> | ||
</> | ||
); | ||
}; | ||
|
||
export default AppLayout; |
1 change: 0 additions & 1 deletion
1
frontend/src/components/pages/travelogueDetail/TravelogueDetailPage.styled.ts
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
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,4 @@ | ||
export const ROUTE_PATHS = { | ||
root: "/", | ||
travelogue: "/travelogue/:id", | ||
} as const; |
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,24 @@ | ||
import { createBrowserRouter } from "react-router-dom"; | ||
|
||
import AppLayout from "@components/layout/AppLayout/AppLayout"; | ||
import TravelogueDetailPage from "@components/pages/travelogueDetail/TravelogueDetailPage"; | ||
|
||
import { ROUTE_PATHS } from "./constants/route"; | ||
|
||
export const router = createBrowserRouter([ | ||
{ | ||
path: ROUTE_PATHS.root, | ||
element: <AppLayout />, | ||
children: [ | ||
{ | ||
path: ROUTE_PATHS.root, | ||
//TODO: 별도의 main page 컴포넌트 추가 해야함 | ||
element: <div>메인 페이지</div>, | ||
}, | ||
{ | ||
path: ROUTE_PATHS.travelogue, | ||
element: <TravelogueDetailPage />, | ||
}, | ||
], | ||
}, | ||
]); |
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
Oops, something went wrong.