-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
49 lines (39 loc) · 1.33 KB
/
App.js
File metadata and controls
49 lines (39 loc) · 1.33 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
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View , ScrollView} from 'react-native';
import SearchScreen from './components/SearchScreen';
import HomeScreen from './components/HomeScreen';
import { createAppContainer, createBottomTabNavigator } from 'react-navigation';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { TextInput, Card, List } from 'react-native-paper';
const TabNavigator = createBottomTabNavigator({
"current city": HomeScreen,
"select city": SearchScreen,
},
{
defaultNavigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
const { routeName } = navigation.state;
let IconComponent = Ionicons;
let iconName;
if (routeName === 'current city') {
iconName = 'md-cloud';
} else if (routeName === 'select city') {
iconName = 'md-options';
}
return <IconComponent name={iconName} size={25} color={tintColor} />;
},
}),
tabBarOptions: {
activeTintColor: 'white',
inactiveTintColor: 'gray',
activeBackgroundColor: '#6200ee',
inactiveBackgroundColor: '#6200ee',
},
},
);
const AppContainer = createAppContainer(TabNavigator);
export default class App extends Component<{}> {
render() {
return <AppContainer />;
}
}