|
1 | 1 | import React from 'react'
|
2 |
| -import {View} from 'react-native' |
| 2 | +import {View, Platform} from 'react-native' |
| 3 | +import {createAppContainer, createBottomTabNavigator} from 'react-navigation' |
3 | 4 | import {Provider} from 'react-redux'
|
4 | 5 | import {createStore} from 'redux'
|
| 6 | +import {FontAwesome, Ionicons} from '@expo/vector-icons' |
5 | 7 |
|
6 | 8 | import AddEntry from './components/AddEntry'
|
| 9 | +import {purple, white} from "./utils/colors" |
| 10 | +import History from "./components/History" |
7 | 11 | import reducer from './reducers'
|
8 |
| -import History from "./components/History"; |
9 | 12 |
|
10 | 13 | const store = createStore(reducer);
|
| 14 | +const Tabs = createBottomTabNavigator({ |
| 15 | + History: { |
| 16 | + screen: History, |
| 17 | + navigationOptions: { |
| 18 | + tabBarLevel: 'History', |
| 19 | + tabBarIcon: ({tintColor}) => <Ionicons name='ios-bookmarks' size={30} color={tintColor}/> |
| 20 | + } |
| 21 | + }, |
| 22 | + AddEntry: { |
| 23 | + screen: AddEntry, |
| 24 | + navigationOptions: { |
| 25 | + tabBarLevel: 'Add Entry', |
| 26 | + tabBarIcon: ({tintColor}) => <FontAwesome name='plus-square' size={30} color={tintColor}/> |
| 27 | + } |
| 28 | + } |
| 29 | +}, { |
| 30 | + tabBarOptions: { |
| 31 | + activeTintColor: Platform.OS === 'ios' ? purple : white, |
| 32 | + style: { |
| 33 | + height: 56, |
| 34 | + backgroundColor: Platform.OS === 'ios' ? white : purple, |
| 35 | + shadowColor: 'rgba(0, 0, 0, 0.24)', |
| 36 | + shadowOffset: { |
| 37 | + width: 0, |
| 38 | + height: 3 |
| 39 | + }, |
| 40 | + shadowRadius: 6, |
| 41 | + shadowOpacity: 1, |
| 42 | + } |
| 43 | + } |
| 44 | +}); |
| 45 | +const Container = createAppContainer(Tabs); |
11 | 46 |
|
12 | 47 | export default class App extends React.Component {
|
13 | 48 | render() {
|
14 | 49 | return (
|
15 | 50 | <Provider store={store}>
|
16 | 51 | <View style={{flex: 1}}>
|
17 |
| - <View style={{height: 20}}/> |
18 |
| - <History/> |
| 52 | + <View style={{height: 20}}/> |
| 53 | + <Container/> |
19 | 54 | </View>
|
20 | 55 | </Provider>
|
21 | 56 | );
|
|
0 commit comments