Skip to content

Commit 682444b

Browse files
committed
feat: 라우팅 설정
1 parent 854d766 commit 682444b

File tree

15 files changed

+104
-3
lines changed

15 files changed

+104
-3
lines changed

src/App.tsx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
import '@/styles/index.css';
2+
import { Route, Routes } from 'react-router';
3+
4+
import Home from './pages/Home';
5+
import LetterBoardPage from './pages/LetterBoard';
6+
import LetterBoardDetailPage from './pages/LetterBoardDetail';
7+
import LetterBoxPage from './pages/LetterBox';
8+
import LetterDetailPage from './pages/LetterDetail';
9+
import LoginPage from './pages/Login';
10+
import MyPage from './pages/MyPage';
11+
import NotificationsPage from './pages/Notifications';
12+
import OnboardingPage from './pages/Onboarding';
13+
import RandomLettersPage from './pages/RandomLetters';
14+
import RollingPaperPage from './pages/RollingPaper';
15+
import WritePage from './pages/Write';
216

317
const App = () => {
4-
return <div>App</div>;
18+
return (
19+
<Routes>
20+
<Route>
21+
<Route index element={<Home />} />
22+
<Route path="login" element={<LoginPage />} />
23+
<Route path="onboarding" element={<OnboardingPage />} />
24+
<Route path="letter">
25+
<Route path="random" element={<RandomLettersPage />} />
26+
<Route path="box" element={<LetterBoxPage />} />
27+
<Route path="write" element={<WritePage />} />
28+
<Route path=":id" element={<LetterDetailPage />} />
29+
</Route>
30+
<Route path="board">
31+
<Route path="letter" element={<LetterBoardPage />} />
32+
<Route path="letter/:id" element={<LetterBoardDetailPage />} />
33+
<Route path="rolling/:id" element={<RollingPaperPage />} />
34+
</Route>
35+
<Route path="mypage">
36+
<Route index element={<MyPage />} />
37+
<Route path="notifications" element={<NotificationsPage />} />
38+
</Route>
39+
</Route>
40+
</Routes>
41+
);
542
};
643

744
export default App;

src/main.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
12
import { StrictMode } from 'react';
23
import { createRoot } from 'react-dom/client';
3-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
4+
import { BrowserRouter } from 'react-router';
5+
46
import App from './App';
57

68
const queryClient = new QueryClient();
79

810
createRoot(document.getElementById('root')!).render(
911
<StrictMode>
1012
<QueryClientProvider client={queryClient}>
11-
<App />
13+
<BrowserRouter>
14+
<App />
15+
</BrowserRouter>
1216
</QueryClientProvider>
1317
</StrictMode>,
1418
);

src/pages/.gitkeep

Whitespace-only changes.

src/pages/Home/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const HomePage = () => {
2+
return <div>HomePage</div>;
3+
};
4+
5+
export default HomePage;

src/pages/LetterBoard/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const LetterBoardPage = () => {
2+
return <div>LetterBoardPage</div>;
3+
};
4+
5+
export default LetterBoardPage;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const LetterBoardDetailPage = () => {
2+
return <div>LetterBoardDetailPage</div>;
3+
};
4+
5+
export default LetterBoardDetailPage;

src/pages/LetterBox/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const LetterBoxPage = () => {
2+
return <div>LetterBoxPage</div>;
3+
};
4+
5+
export default LetterBoxPage;

src/pages/LetterDetail/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const LetterDetailPage = () => {
2+
return <div>LetterDetailPage</div>;
3+
};
4+
5+
export default LetterDetailPage;

src/pages/Login/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const LoginPage = () => {
2+
return <div>LoginPage</div>;
3+
};
4+
5+
export default LoginPage;

src/pages/MyPage/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const MyPage = () => {
2+
return <div>MyPage</div>;
3+
};
4+
5+
export default MyPage;

0 commit comments

Comments
 (0)