-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.tsx
More file actions
227 lines (223 loc) · 7.87 KB
/
App.tsx
File metadata and controls
227 lines (223 loc) · 7.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
import { lazy } from 'react';
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ThemeProvider } from 'styled-components';
import { ScrollToTopButton } from '@/components/common/ScrollToTopButton/ScrollToTopButton';
import { AdminClubProvider } from '@/context/AdminClubContext';
import { ScrollToTop } from '@/hooks/Scroll/ScrollToTop';
import LoginTab from '@/pages/AdminPage/auth/LoginTab/LoginTab';
import PrivateRoute from '@/pages/AdminPage/auth/PrivateRoute/PrivateRoute';
import ClubDetailPage from '@/pages/ClubDetailPage/ClubDetailPage';
import ClubMapPage from '@/pages/ClubMapPage/ClubMapPage';
import MainPage from '@/pages/MainPage/MainPage';
import GlobalStyles from '@/styles/Global.styles';
import { theme } from '@/styles/theme';
import ApplicationFormPage from './pages/ApplicationFormPage/ApplicationFormPage';
import GoogleCallbackPage from './pages/CallbackPage/GoogleCallbackPage';
import ClubUnionPage from './pages/ClubUnionPage/ClubUnionPage';
import IntroducePage from './pages/IntroducePage/IntroducePage';
import 'swiper/css';
import {
ContentErrorBoundary,
GlobalBoundary,
} from './components/common/ErrorBoundary';
import LegacyClubDetailPage from './pages/ClubDetailPage/LegacyClubDetailPage';
import ErrorTestPage from './pages/ErrorTestPage/ErrorTestPage';
import IntroductionPage from './pages/FestivalPage/IntroductionPage/IntroductionPage';
import GamePage from './pages/GamePage/GamePage';
import PromotionDetailPage from './pages/PromotionPage/PromotionDetailPage';
import PromotionListPage from './pages/PromotionPage/PromotionListPage';
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000,
retry: 1,
},
mutations: {
retry: 0,
},
},
});
const AdminRoutes = lazy(() => import('@/pages/AdminPage/AdminRoutes'));
const App = () => {
return (
<>
<GlobalStyles />
<GlobalBoundary>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<BrowserRouter>
<ScrollToTop />
<ScrollToTopButton />
<Routes>
<Route
path='/'
element={
<ContentErrorBoundary>
<MainPage />
</ContentErrorBoundary>
}
/>
{/*기존 웹 & 안드로이드 url (android: v1.1.0)*/}
<Route
path='/club/:clubId'
element={
<ContentErrorBoundary>
<LegacyClubDetailPage />
</ContentErrorBoundary>
}
/>
{/*웹 유저에게 신규 상세페이지 보유주기 위한 임시 url*/}
<Route
path='/clubDetail/:clubId'
element={
<ContentErrorBoundary>
<ClubDetailPage />
</ContentErrorBoundary>
}
/>
<Route
path='/clubDetail/:clubId/map'
element={
<ContentErrorBoundary>
<ClubMapPage />
</ContentErrorBoundary>
}
/>
{/*한국어핸들 */}
<Route
path='/clubDetail/@:clubName'
element={
<ContentErrorBoundary>
<ClubDetailPage />
</ContentErrorBoundary>
}
/>
<Route
path='/clubDetail/@:clubName/map'
element={
<ContentErrorBoundary>
<ClubMapPage />
</ContentErrorBoundary>
}
/>
{/*새로 빌드해서 배포할 앱 주소 url*/}
<Route
path='/webview/club/:clubId'
element={
<ContentErrorBoundary>
<ClubDetailPage />
</ContentErrorBoundary>
}
/>
<Route
path='/webview/club/:clubId/map'
element={
<ContentErrorBoundary>
<ClubMapPage />
</ContentErrorBoundary>
}
/>
<Route
path='/webview/club/@:clubName'
element={
<ContentErrorBoundary>
<ClubDetailPage />
</ContentErrorBoundary>
}
/>
<Route
path='/webview/club/@:clubName/map'
element={
<ContentErrorBoundary>
<ClubMapPage />
</ContentErrorBoundary>
}
/>
<Route
path='/introduce'
element={
<ContentErrorBoundary>
<IntroducePage />
</ContentErrorBoundary>
}
/>
<Route
path='/callback/google'
element={<GoogleCallbackPage />}
/>
<Route path='/admin/login' element={<LoginTab />} />
<Route
path='/admin/*'
element={
<ContentErrorBoundary>
<AdminClubProvider>
<PrivateRoute>
<AdminRoutes />
</PrivateRoute>
</AdminClubProvider>
</ContentErrorBoundary>
}
/>
<Route
path='/application/:clubId/:applicationFormId'
element={
<ContentErrorBoundary>
<ApplicationFormPage />
</ContentErrorBoundary>
}
/>
<Route
path='/club-union'
element={
<ContentErrorBoundary>
<ClubUnionPage />
</ContentErrorBoundary>
}
/>
<Route
path='/festival-introduction'
element={
<ContentErrorBoundary>
<IntroductionPage />
</ContentErrorBoundary>
}
/>
<Route
path='/promotions'
element={
<ContentErrorBoundary>
<PromotionListPage />
</ContentErrorBoundary>
}
/>
<Route
path='/promotions/:promotionId'
element={
<ContentErrorBoundary>
<PromotionDetailPage />
</ContentErrorBoundary>
}
/>
<Route
path='/game'
element={
<ContentErrorBoundary>
<GamePage />
</ContentErrorBoundary>
}
/>
{/* 개발 환경에서만 사용 가능한 에러 테스트 페이지 */}
{import.meta.env.DEV && (
<Route path='/error-test' element={<ErrorTestPage />} />
)}
<Route path='*' element={<Navigate to='/' replace />} />
</Routes>
</BrowserRouter>
</ThemeProvider>
</QueryClientProvider>
</GlobalBoundary>
</>
);
};
export default App;