-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
89 lines (83 loc) · 2.8 KB
/
Copy pathApp.js
File metadata and controls
89 lines (83 loc) · 2.8 KB
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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator, HeaderBackground } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Provider } from 'react-redux';
import { StyleSheet } from 'react-native';
import { Container, Header, Left, Body, Right, Button, Title, Text } from 'native-base';
import Icon from 'react-native-vector-icons/FontAwesome';
import MyAdventuresScreen from './src/components/screens/MyAdventuresScreen';
import MyGoalsScreen from './src/components/screens/MyGoalsScreen';
import NewGoalScreen from './src/components/screens/NewGoalScreen';
import store from './src/store/store';
import { TouchableOpacity } from 'react-native-gesture-handler';
const AdventuresStack = createStackNavigator();
function AdventuresStackScreen() {
return (
<AdventuresStack.Navigator>
<AdventuresStack.Screen name="Adventures" component={MyAdventuresScreen} />
</AdventuresStack.Navigator>
);
}
const GoalsStack = createStackNavigator();
function GoalsStackScreen() {
return (
<GoalsStack.Navigator>
<GoalsStack.Screen
name="Goals"
component={MyGoalsScreen}
options={
({ navigation }) => ({
headerRight: () => (
<TouchableOpacity>
<Button transparent style={{padding: 5}} onPress={() => navigation.navigate('New Goal')}>
<Icon name="plus" size={20} color="blue"/>
</Button>
</TouchableOpacity>
)
})
}
/>
<GoalsStack.Screen name="New Goal" component={NewGoalScreen} />
</GoalsStack.Navigator>
);
}
const Tab = createBottomTabNavigator();
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<NavigationContainer>
<Tab.Navigator
initialRouteName="Adventures"
tabBarOptions={{
activeTintColor: 'green',
inactiveTintColor: 'black',
}}
>
<Tab.Screen
name="Adventures"
component={AdventuresStackScreen}
options={{
tabBarLabel: 'Adventures',
tabBarIcon: ({ color, size }) => (
<Icon name="map" size={20} color="black" />
),
}}
/>
<Tab.Screen
name="Goals"
component={GoalsStackScreen}
options={{
tabBarLabel: 'Goals',
tabBarIcon: ({ color, size }) => (
<Icon name="trophy" size={20} color="black" />
),
}}
/>
</Tab.Navigator>
</NavigationContainer>
</Provider>
);
}
}