-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
104 lines (98 loc) · 3.09 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/Feather';
import Main from './screens/main';
import News from './screens/news';
import Search from './screens/search';
import MyWeb from './screens/webview';
const MainStack = createNativeStackNavigator();
const NewsStack = createNativeStackNavigator();
const SearchStack = createNativeStackNavigator();
function MainStackScreen() {
return (
<MainStack.Navigator>
<MainStack.Screen name="Main" component={Main} options={{ headerShown: false }}/>
<MainStack.Screen
name="Web"
component={MyWeb}
options={({ route }) => ({
title: route.params.title,
headerTitleStyle: {
fontFamily:'Martel-ExtraBold',
fontWeight: "bold",
fontSize: 22
},
})}
/>
</MainStack.Navigator>
);
}
function NewsStackScreen() {
return (
<NewsStack.Navigator>
<NewsStack.Screen name="News" component={News} options={{ headerShown: false }}/>
<NewsStack.Screen
name="Web"
component={MyWeb}
options={({ route }) => ({
title: route.params.title,
headerTitleStyle: {
fontFamily:'Martel-ExtraBold',
fontWeight: "bold",
fontSize: 22
},
})}
/>
</NewsStack.Navigator>
);
}
function SearchStackScreen() {
return (
<SearchStack.Navigator>
<SearchStack.Screen name="Search" component={Search} options={{ headerShown: false }}/>
<SearchStack.Screen
name="Web"
component={MyWeb}
options={({ route }) => ({
title: route.params.title,
headerTitleStyle: {
fontFamily:'Martel-ExtraBold',
fontWeight: "bold",
fontSize: 22
},
})}
/>
</SearchStack.Navigator>
);
}
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
if (route.name === 'Main') {
return <Icon name="home" color={color} size={30}/>
} else if (route.name === 'News') {
return <Icon name="sliders" color={color} size={30}/>
} else if (route.name === 'Search') {
return <Icon name="search" color={color} size={30}/>
}
},
initialRouteName: 'Main',
tabBarShowLabel: false,
tabBarActiveTintColor: '#000000',
tabBarInactiveTintColor: '#c4c4c4',
headerShown: false
})}
>
<Tab.Screen name="Main" component={MainStackScreen} />
<Tab.Screen name="News" component={NewsStackScreen} />
<Tab.Screen name="Search" component={SearchStackScreen} />
</Tab.Navigator>
</NavigationContainer>
);
}