-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
199 lines (189 loc) · 5.68 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
import {
Button,
Image,
LogBox,
Pressable,
StyleSheet,
Text,
View,
YellowBox,
} from "react-native";
import Constants from "expo-constants";
import styled from "styled-components/native";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import ButtonStorage from "./assets/svg/ButtonStorage";
import ButtonMyPage from "./assets/svg/ButtonMyPage";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Main from "./pages/Main";
import DiaryWriting from "./pages/Diary/DiaryWriting";
import BackButton from "./assets/svg/BackButton";
import CrystalReply from "./pages/Storage/CrystalReply";
import React from "react";
import CustomHeader from "./components/molecule/header/CustomHeader";
import DiaryAnswer from "./pages/Diary/DiaryAnswer";
import Login from "./pages/Join/Login";
import { AuthProvider } from "./context/AuthContext";
import AppLoading from "./pages/Splash/AppLoading";
import ProfileSetting from "./pages/Join/ProfileSetting";
import ReplyBoxDetail from "./pages/Storage/ReplyBoxDetail";
import SplashLoading from "./pages/Splash/SplashLoading";
interface Warning {
message: string;
}
function App() {
LogBox.ignoreAllLogs();
const Tab = createNativeStackNavigator();
return (
<NavigationContainer>
<AuthProvider>
<Tab.Navigator initialRouteName="SplashLoading">
<Tab.Screen
name="SplashLoading"
component={SplashLoading}
options={{ headerShown: false }}
/>
<Tab.Screen
name="Main"
component={Main}
options={{ headerShown: false }}
/>
<Tab.Screen
name="DiaryWriting"
component={DiaryWriting}
options={({ navigation }) => ({
title: "일기 쓰기",
headerTransparent: true, // Make header transparent
headerLeft: () => (
<Pressable onPress={() => navigation.goBack()}>
<BackButton />
</Pressable>
),
})}
/>
<Tab.Screen
name="DiaryAnswer"
component={DiaryAnswer}
options={() => ({
title: "일기 쓰기",
headerTransparent: true, // Make header transparent
headerLeft: () => <></>,
})}
/>
<Tab.Screen
name="CrystalReply"
component={CrystalReply}
options={({ navigation }) => ({
title: "결정 보관함",
headerTransparent: true,
header: () => (
<CustomHeader
navigation={navigation}
title="결정 보관함"
showBackButton={true}
showBottomLine={true}
/>
),
tabBarIcon: () => (
<ButtonContainer>
<ButtonStorage />
</ButtonContainer>
),
})}
/>
<Tab.Screen
name="ReplyBoxDetail"
component={ReplyBoxDetail}
options={({ navigation }) => ({
title: "결정 보관함",
headerTransparent: true,
header: () => (
<CustomHeader
navigation={navigation}
title="결정 보관함"
showBackButton={true}
showBottomLine={true}
/>
),
tabBarIcon: () => (
<ButtonContainer>
<ButtonStorage />
</ButtonContainer>
),
})}
/>
<Tab.Screen
name="Login"
component={Login}
options={() => ({
headerTransparent: true,
headerTitle: "",
})}
/>
<Tab.Screen
name="ProfileSetting"
component={ProfileSetting}
options={({ navigation }) => ({
headerTransparent: true,
headerTitle: "",
header: () => (
<CustomHeader
navigation={navigation}
title="프로필 설정"
showBackButton={true}
showBottomLine={true}
/>
),
screenNavigation: navigation,
})}
/>
<Tab.Screen
name="AppLoading"
component={AppLoading}
options={() => ({
headerTransparent: true,
headerTitle: "",
})}
/>
</Tab.Navigator>
</AuthProvider>
</NavigationContainer>
);
}
let AppEntryPoint = App;
if (Constants.expoConfig?.extra?.storybookEnabled === "true") {
AppEntryPoint = require("./.ondevice").default;
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
const Container = styled.View`
width: 100px;
height: 40px;
background-color: blue;
`;
const ButtonContainer = styled.View`
margin-top: 25px;
`;
export default AppEntryPoint;
// tabBarIcon: () => (
// <View style={{position: 'relative'}}>
// <Animated.Image
// source={require('../../../assets/images/HomeIcon2.png')}
// style={{
// ...animationStyle,
// width: Platform.OS === 'android' ? 71 : 65,
// height: Platform.OS === 'android' ? 66 : 61,
// shadowColor: '#000',
// shadowOffset: {width: 0, height: 2},
// shadowOpacity: 0.1,
// shadowRadius: 2,
// }}
// />
// </View>
// ),