-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
447 lines (437 loc) · 16.3 KB
/
App.tsx
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
import { StatusBar } from 'expo-status-bar'
import {
StyleSheet,
Text,
View,
TouchableOpacity,
TextInput,
} from 'react-native'
import {
NavigationContainer,
useNavigation,
NavigationProp,
RouteProp,
} from '@react-navigation/native'
import {
createNativeStackNavigator,
NativeStackNavigationProp,
} from '@react-navigation/native-stack'
import { createDrawerNavigator } from '@react-navigation/drawer'
import RecentGatherings from './src/screens/gathering/GatheringHomeScreen'
import { GlobalStyles } from './src/constants/colors'
import GatheringsContextProvider from './src/context/gathering-context'
import Icon from 'react-native-vector-icons/MaterialIcons' // MaterialIcons 아이콘 사용
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import GatheringLocationSearch from './src/screens/gathering/GatheringLocationSearchScreen'
import GatheringRegister from './src/screens/gathering/GatheringRegisterScreen'
import GatheringDetailScreen from './src/screens/gathering/GatheringDetailScreen'
import ScheduleHome from '@/screens/schedule/ScheduleHomeScreen'
import ScheduleSpot from '@/screens/schedule/ScheduleSpotScreen'
import ScheduleDetail from '@/screens/schedule/ScheduleDetailScreen'
import ScheduleCalendar from '@/screens/schedule/ScheduleCalendarScreen'
import PlaceSearchComponent from '@/screens/schedule/SchedulePlaceSearch'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import Ionicons from 'react-native-vector-icons/Ionicons'
//import { MainDummyHome } from '@/screens/dummyHome/mainHomeDummy'
import MainDummyHome from '@/screens/dummyHome/mainHomeDummy'
import { ChatHomeDummy } from '@/screens/dummyHome/ChatHomeDummy'
import LoginHomeScreen from '@/screens/login/LoginHomeScreen2'
import MyPageScreen from '@/screens/mypage/MypageHomeScreen'
import KakaoLoginView from '@/screens/login/KakaoLoginView'
import ChatHomeScreen from '@/screens/chat/ChatHomeScreen'
import MainHomeScreen from '@/screens/mainhome/MainHomeScreen'
import HomePostScreen from '@/screens/mainhome/HomePostScreen'
import HomePostWriteScreen from '@/screens/mainhome/HomePostWriteScreen'
import ChatRoomDetail from '@/screens/chat/ChatRoomDetailScreen'
import LoginScreen from '@/screens/login/LoginHomeScreen2'
import { ChatProvider } from '@/context/chat-context'
import { ScheduleProvider } from '@/context/ScheduleProvide'
import GatheringRegisterLocationSearchScreen from '@/screens/gathering/GatheringRegisterLocationSearch'
const Stack = createNativeStackNavigator<RootStackParamList>() // 네비게이션 스택에 타입 정의 적용
const Drawer = createDrawerNavigator()
const BottomTabs = createBottomTabNavigator()
function WeGoTooOverview() {
//const navigation = useNavigation()
return (
<BottomTabs.Navigator
screenOptions={({ navigation }) => ({
//headerStyle: { backgroundColor: GlobalStyles.colors.primary500 },
//headerTintColor: 'white',
//tabBarStyle: { backgroundColor: GlobalStyles.colors.primary500 },
tabBarActiveTintColor: GlobalStyles.colors.signature,
})}
>
<BottomTabs.Screen
name="MainHome"
component={MainHomeScreen}
options={{
title: '메인 홈화면',
tabBarLabel: '메인 홈화면',
tabBarIcon: ({ color, size }) => (
<Ionicons name="home" size={size} color={color} />
),
headerShown: false,
// headerTitleAlign: 'center',
//headerStyle: { backgroundColor: 'white' },
//contentStyle: { backgroundColor: 'white' },
}}
/>
<BottomTabs.Screen
name="BtScheduleHome"
component={ScheduleHome}
options={{
headerShown: false,
title: '일정관리 홈화면',
tabBarLabel: '일정관리 홈화면',
tabBarIcon: ({ color, size }) => (
<Ionicons name="map" size={size} color={color} />
),
}}
/>
<BottomTabs.Screen
name="BtRecentGathering"
component={RecentGatherings}
options={{
title: '모집글 홈화면',
tabBarLabel: '모집글 홈화면',
tabBarIcon: ({ color, size }) => (
<Ionicons name="document-text" size={size} color={color} />
),
/* header: ({ navigation }) => (
<GatheringHomeHeader navigation={navigation} />
), */
headerShown: false,
}}
/>
<BottomTabs.Screen
name="ChatHomeScreen"
component={ChatHomeScreen}
options={{
title: '채팅 홈화면',
tabBarLabel: '채팅 홈화면',
tabBarIcon: ({ color, size }) => (
<Ionicons name="chatbubbles" size={size} color={color} />
),
headerShown: false,
}}
/>
<BottomTabs.Screen
name="MypageHomeDummy"
component={MyPageScreen}
options={{
title: '마이페이지',
tabBarLabel: '마이페이지',
tabBarIcon: ({ color, size }) => (
<Ionicons name="person" size={size} color={color} />
),
headerShown: false,
}}
/>
</BottomTabs.Navigator>
)
}
// 네비게이션 스택의 타입을 정의합니다.
export type RootStackParamList = {
RecentGathering: undefined
GatheringLocationSearch: undefined
GatheringRegister: undefined
GatheringDetail: { gatheringId: number } // GatheringDetail에 전달되는 파라미터 정의
ScheduleHome: undefined
SceduleSpot: { startDate: string; endDate: string }
SceduleDetail: undefined
SceduleCalendar: undefined
SchedulePlaceSearch: { detailedId: number; date: string }
WeGoTooOverview: undefined
KakaoLoginView: undefined
LoginHomeScreen: undefined
MainHomeScreen: undefined
HomePostWriteScreen: undefined
HomePostScreen: { postId: number }
ChatRoomDetail: { roomId: number; title: string }
GatheringRegisterLocationSearch: undefined
}
interface GatheringHomeHeaderProps {
navigation: NavigationProp<any>
}
const GatheringHomeHeader: React.FC<GatheringHomeHeaderProps> = ({
navigation,
}) => {
return (
<View style={{ marginTop: 30 }}>
{/* 첫 번째 줄 (WEGOTOO, 돋보기 아이콘, 종 아이콘) */}
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
paddingHorizontal: 15,
paddingVertical: 10,
}}
>
{/* WEGOTOO 텍스트 로고 */}
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#FF6B6B' }}>
WEGOTOO
</Text>
{/* 검색 아이콘과 알림 아이콘 */}
<View style={{ flexDirection: 'row' }}>
<TouchableOpacity
style={{ marginRight: 20 }}
onPress={() => console.log('Search pressed')}
>
<Icon name="search" size={24} color="black" />
</TouchableOpacity>
<TouchableOpacity
onPress={() => console.log('Notifications pressed')}
>
<Icon name="notifications-none" size={24} color="black" />
</TouchableOpacity>
</View>
</View>
{/* 두 번째 줄 (필터 아이콘, 오사카 버튼) */}
<View
style={{
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 15,
paddingVertical: 5,
}}
>
{/* 필터 아이콘 */}
<TouchableOpacity
style={{
flexDirection: 'row',
alignItems: 'center',
marginRight: 10,
}}
onPress={() =>
navigation.navigate('GatheringLocationSearch', { inputText: '' })
}
>
<Icon name="list" size={30} color="#FF6B6B" />
</TouchableOpacity>
</View>
</View>
)
}
export default function App() {
return (
<>
<StatusBar style="dark" />
<GestureHandlerRootView style={{ flex: 1 }}>
<GatheringsContextProvider>
<ScheduleProvider>
<ChatProvider>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="LoginHomeScreen"
component={LoginHomeScreen}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="KakaoLoginView"
component={KakaoLoginView} // 타입이 정의된 컴포넌트 전달
options={{
headerBackTitleVisible: false,
headerTitleAlign: 'center',
headerShown: false,
}}
/>
<Stack.Screen
name="WeGoTooOverview"
component={WeGoTooOverview}
options={{ headerShown: false }}
/>
<Stack.Screen
name="MainHomeScreen"
component={MainHomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="HomePostWriteScreen"
component={HomePostWriteScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="HomePostScreen"
options={{
headerShown: false,
}}
>
{(props) => (
<HomePostScreen
{...props}
postId={props.route.params.postId}
/>
)}
</Stack.Screen>
{/* <Stack.Screen
name="LoginHomeScreen"
component={LoginHomeScreen}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="KakaoLoginView"
component={KakaoLoginView} // 타입이 정의된 컴포넌트 전달
options={{
headerBackTitleVisible: false,
headerTitleAlign: 'center',
headerShown: false,
}}
/> */}
<Stack.Screen
name="ScheduleHome"
component={ScheduleHome}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="SceduleCalendar"
component={ScheduleCalendar}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="SceduleSpot"
options={{
headerShown: false,
}}
>
{(props) => (
<ScheduleSpot
{...props}
startDate={props.route.params.startDate}
endDate={props.route.params.endDate}
/>
)}
</Stack.Screen>
<Stack.Screen
name="SchedulePlaceSearch"
options={{
headerShown: false,
}}
>
{(props) => (
<PlaceSearchComponent
{...props}
detailedId={props.route.params.detailedId}
date={props.route.params.date}
/>
)}
</Stack.Screen>
<Stack.Screen
name="SceduleDetail"
component={ScheduleDetail}
options={{
headerShown: false,
}}
/>
{/* <Stack.Screen
name="RecentGathering"
component={RecentGatherings}
options={{
header: ({ navigation }) => (
<GatheringHomeHeader navigation={navigation} />
),
contentStyle: { backgroundColor: 'white' },
}}
/>
<Stack.Screen
name="GatheringLocationSearch"
component={GatheringLocationSearch}
options={{
animation: 'slide_from_left',
headerBackTitleVisible: false,
headerTitleAlign: 'center',
headerShown: false,
}}
/>
<Stack.Screen
name="GatheringRegister"
component={GatheringRegister}
options={{
headerBackTitleVisible: false, // 뒤로가기 텍스트 숨기기
headerTitleAlign: 'center',
headerTintColor: 'black', // 뒤로가기 버튼 아이콘 색상을 검정색으로 설정
headerStyle: {
backgroundColor: 'white', // 헤더 배경색 설정
},
}}
/>
<Stack.Screen
name="GatheringDetail"
component={GatheringDetailScreen} // 타입이 정의된 컴포넌트 전달
options={{
headerBackTitleVisible: false, // 뒤로가기 텍스트 숨기기
headerTitleAlign: 'center',
headerTintColor: 'black', // 뒤로가기 버튼 아이콘 색상을 검정색으로 설정
headerStyle: {
backgroundColor: 'white', // 헤더 배경색 설정
},
}}
/>
</Stack.Navigator>
</NavigationContainer>
/> */}
<Stack.Screen
name="GatheringLocationSearch"
component={GatheringLocationSearch}
options={{
animation: 'slide_from_left',
headerBackTitleVisible: false,
headerTitleAlign: 'center',
headerShown: false,
}}
/>
<Stack.Screen
name="GatheringRegister"
component={GatheringRegister}
options={{
headerBackTitleVisible: false, // 뒤로가기 텍스트 숨기기
headerTitleAlign: 'center',
headerTintColor: 'black', // 뒤로가기 버튼 아이콘 색상을 검정색으로 설정
headerStyle: {
backgroundColor: 'white', // 헤더 배경색 설정
},
}}
/>
<Stack.Screen
name="GatheringDetail"
component={GatheringDetailScreen} // 타입이 정의된 컴포넌트 전달
options={{
headerBackTitleVisible: false, // 뒤로가기 텍스트 숨기기
headerTitleAlign: 'center',
headerTintColor: 'black', // 뒤로가기 버튼 아이콘 색상을 검정색으로 설정
headerStyle: {
backgroundColor: 'white', // 헤더 배경색 설정
},
}}
/>
<Stack.Screen
name="ChatRoomDetail"
component={ChatRoomDetail} // 타입이 정의된 컴포넌트 전달
options={{
headerBackTitleVisible: false, // 뒤로가기 텍스트 숨기기
headerTitleAlign: 'center',
headerTintColor: 'black', // 뒤로가기 버튼 아이콘 색상을 검정색으로 설정
headerStyle: {
backgroundColor: 'white', // 헤더 배경색 설정
},
}}
/>
</Stack.Navigator>
</NavigationContainer>
</ChatProvider>
</ScheduleProvider>
</GatheringsContextProvider>
</GestureHandlerRootView>
</>
)
}
const styles = StyleSheet.create({})