|
1 | 1 | import { index, layout, route, type RouteConfig } from '@react-router/dev/routes'; |
2 | 2 |
|
3 | 3 | export default [ |
4 | | - // (auth) - 레이아웃 없는 인증 페이지 |
5 | | - route('login', 'routes/(auth)/login.tsx'), |
6 | | - route('signup', 'routes/(auth)/signup.tsx'), |
| 4 | + // (auth) - 비로그인만 접근 가능 (로그인 시 / 로 리다이렉트) |
| 5 | + layout('layout/PublicLayout.tsx', [ |
| 6 | + route('login', 'routes/(auth)/login.tsx'), |
| 7 | + route('signup', 'routes/(auth)/signup.tsx'), |
| 8 | + ]), |
| 9 | + |
| 10 | + // 카카오 콜백 (인증 체크 불필요) |
| 11 | + route('login/kakao', 'routes/(auth)/login.kakao.tsx'), |
7 | 12 |
|
8 | 13 | // (main) - MainLayout 적용 페이지 |
9 | 14 | layout('layout/MainLayout.tsx', [ |
| 15 | + // 공개 페이지 (누구나 접근 가능) |
10 | 16 | index('routes/(main)/_index.tsx'), |
11 | 17 |
|
12 | 18 | // buy |
13 | 19 | route('buy', 'routes/(main)/buy/index.tsx'), |
14 | 20 | route('buy/:id', 'routes/(main)/buy/detail.tsx'), |
15 | 21 |
|
16 | | - // sell |
17 | | - route('sell', 'routes/(main)/sell/index.tsx'), |
18 | | - route('sell/confirm', 'routes/(main)/sell/confirm.tsx'), |
19 | | - |
20 | 22 | // repair |
21 | 23 | route('repair', 'routes/(main)/repair/index.tsx'), |
22 | 24 |
|
23 | | - // mypage |
24 | | - route('mypage', 'routes/(main)/mypage/index.tsx'), |
25 | | - route('mypage/settings', 'routes/(main)/mypage/settings.tsx'), |
26 | | - route('mypage/profile', 'routes/(main)/mypage/profile.tsx'), |
27 | | - |
28 | 25 | // seller |
29 | 26 | route('seller/:userId', 'routes/(main)/seller/index.tsx'), |
30 | 27 |
|
31 | | - // chatbot |
32 | | - route('chatbot', 'routes/(main)/chatbot/index.tsx'), |
| 28 | + // 로그인 필요 페이지 (미로그인 시 /login 으로 리다이렉트) |
| 29 | + layout('layout/ProtectedLayout.tsx', [ |
| 30 | + // sell |
| 31 | + route('sell', 'routes/(main)/sell/index.tsx'), |
| 32 | + route('sell/confirm', 'routes/(main)/sell/confirm.tsx'), |
| 33 | + |
| 34 | + // mypage |
| 35 | + route('mypage', 'routes/(main)/mypage/index.tsx'), |
| 36 | + route('mypage/settings', 'routes/(main)/mypage/settings.tsx'), |
| 37 | + route('mypage/profile', 'routes/(main)/mypage/profile.tsx'), |
| 38 | + |
| 39 | + // chatbot |
| 40 | + route('chatbot', 'routes/(main)/chatbot/index.tsx'), |
| 41 | + ]), |
33 | 42 | ]), |
34 | 43 | ] satisfies RouteConfig; |
0 commit comments