-
Notifications
You must be signed in to change notification settings - Fork 13
/
App.js
69 lines (64 loc) · 2.1 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
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { FontAwesome } from "@expo/vector-icons";
import { PersistGate } from "redux-persist/integration/react";
import { store, persistor } from "./store";
import { Provider } from "react-redux";
import { HomeScreen } from "./screens/HomeScreen";
import { ArticleScreen } from "./screens/ArticleScreen";
import { ClipScreen } from "./screens/ClipScreen";
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
const screenOption = ({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
switch (route.name) {
case "HomeStack":
iconName = "home";
break;
case "ClipStack":
iconName = "bookmark";
break;
}
return <FontAwesome name={iconName} size={size} color={color} />;
},
});
const HomeStack = () => {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} options={{ headerShown: false }} />
<Stack.Screen name="Article" component={ArticleScreen} />
</Stack.Navigator>
);
};
const ClipStack = () => {
return (
<Stack.Navigator>
<Stack.Screen name="Clip" component={ClipScreen} options={{ headerShown: false }} />
<Stack.Screen name="Article" component={ArticleScreen} />
</Stack.Navigator>
);
};
export default function App() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<NavigationContainer>
<Tab.Navigator screenOptions={screenOption}>
<Tab.Screen
name="HomeStack"
component={HomeStack}
options={{ headerShown: false, title: "Home" }}
/>
<Tab.Screen
name="ClipStack"
component={ClipStack}
options={{ headerShown: false, title: "Clip" }}
/>
</Tab.Navigator>
</NavigationContainer>
</PersistGate>
</Provider>
);
}