-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
176 lines (165 loc) · 4.84 KB
/
App.js
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
import * as React from 'react';
import {Text, View} from 'react-native';
import {
heightPercentageToDP as hp,
widthPercentageToDP as wp,
} from 'react-native-responsive-screen';
import Detail from './src/screens/Detail';
import Home from './src/screens/Home';
import Icon from 'react-native-vector-icons/Ionicons';
import Logo from './src/components/Logo';
import {MyContext} from './src/components/MyContext';
import {NavigationContainer} from '@react-navigation/native';
import Youtube from "./src/screens/Youtube"
import color from './assets/colors';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {createStackNavigator} from '@react-navigation/stack';
import {navigationRef} from './src/components/RootNavigation';
const Stack = createStackNavigator();
function MainNavigator() {
return (
<Stack.Navigator
screenOptions={{
headerTitleStyle: {
fontWeight: 'bold',
textAlign: 'center',
margin: 10,
flex: 1,
color: color.secondary,
},
headerStyle: {
backgroundColor: color.primary,
},
headerTintColor: color.secondary,
headerTitleAlign: 'center',
animationTypeForReplace: 'pop',
backgroundColor: color.secondary,
}}>
<Stack.Screen
name="Twitchifier"
options={{headerTitle: (props) => <Logo></Logo>}}
component={Home}
/>
<Stack.Screen
name="Twitter"
options={{headerTitle: (props) => <Logo></Logo>}}
component={Detail}
/>
</Stack.Navigator>
);
}
const DetailStack = createStackNavigator();
function YoutubeNavigator(){
return(
<DetailStack.Navigator
screenOptions={{
headerTitleStyle: {
fontWeight: 'bold',
textAlign: 'center',
margin: 100,
flex: 1,
color: color.secondary,
},
headerStyle: {
backgroundColor: color.primary,
},
headerTintColor: color.secondary,
headerTitleAlign: 'center',
animationTypeForReplace: 'pop',
backgroundColor: color.secondary,
}}>
<DetailStack.Screen
name="Youtube"
options={{headerTitle: (props) => <Logo></Logo>}}
component={Youtube}
/>
</DetailStack.Navigator>
)
}
function DetailNavigator() {
return (
<DetailStack.Navigator
screenOptions={{
headerTitleStyle: {
fontWeight: 'bold',
textAlign: 'center',
margin: 100,
flex: 1,
color: color.secondary,
},
headerStyle: {
backgroundColor: color.primary,
},
headerTintColor: color.secondary,
headerTitleAlign: 'center',
animationTypeForReplace: 'pop',
backgroundColor: color.secondary,
}}>
<DetailStack.Screen
name="Twitter"
options={{headerTitle: (props) => <Logo></Logo>}}
component={Detail}
/>
</DetailStack.Navigator>
);
}
const Bottom = createBottomTabNavigator();
export default function App() {
return (
<MyContext>
<NavigationContainer ref={navigationRef}>
<Bottom.Navigator
tabBarOptions={{
activeTintColor: color.primary,
inactiveTintColor: color.primary,
activeBackgroundColor: color.dark,
inactiveBackgroundColor: color.dark2,
tabStyle: {
alignSelf: 'center',
justifyContent: 'center',
padding: wp(0),
},
showLabel: false,
labelStyle: {
fontSize: hp(1),
},
}}
screenOptions={({route}) => ({
tabBarIcon: () => {
if (route.name === 'Main') {
return (
<View>
<Icon
name={'logo-twitch'}
size={30}
color={`${color.primary}`}
/>
</View>
);
} else if (route.name === 'Twitter') {
return (
<View>
<Icon
name={'logo-twitter'}
size={30}
color={`${color.primary}`}
/>
</View>
);
} else if (route.name === 'Youtube') {
return (
<View>
<Icon name={"logo-youtube"} size={30} color={color.primary} />
</View>
);
}
},
})}>
<Bottom.Screen name="Main" component={MainNavigator} />
<Bottom.Screen name="Twitter" component={DetailNavigator} />
<Bottom.Screen name="Youtube" component={YoutubeNavigator} />
</Bottom.Navigator>
</NavigationContainer>
</MyContext>
);
}