11import { index , layout , route , type RouteConfig } from '@react-router/dev/routes' ;
22
33export 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' ) ,
712
813 // (main) - MainLayout 적용 페이지
914 layout ( 'layout/MainLayout.tsx' , [
15+ // 공개 페이지 (누구나 접근 가능)
1016 index ( 'routes/(main)/_index.tsx' ) ,
1117
1218 // buy
1319 route ( 'buy' , 'routes/(main)/buy/index.tsx' ) ,
1420 route ( 'buy/:id' , 'routes/(main)/buy/detail.tsx' ) ,
1521
16- // sell
17- route ( 'sell' , 'routes/(main)/sell/index.tsx' ) ,
18- route ( 'sell/confirm' , 'routes/(main)/sell/confirm.tsx' ) ,
19-
2022 // repair
2123 route ( 'repair' , 'routes/(main)/repair/index.tsx' ) ,
2224
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-
2825 // seller
2926 route ( 'seller/:userId' , 'routes/(main)/seller/index.tsx' ) ,
3027
31- // chat
32- route ( 'chat' , 'routes/(main)/chat/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+ // chat
40+ route ( 'chat' , 'routes/(main)/chat/index.tsx' ) ,
3341
34- // chatbot
35- route ( 'chatbot' , 'routes/(main)/chatbot/index.tsx' ) ,
42+ // chatbot
43+ route ( 'chatbot' , 'routes/(main)/chatbot/index.tsx' ) ,
44+ ] ) ,
3645 ] ) ,
37- ] satisfies RouteConfig ;
46+ ] satisfies RouteConfig ;
0 commit comments