-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.android.js
57 lines (53 loc) · 1.52 KB
/
index.android.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
/**
* @name Tweather
* @author Thony Hermawan
* @description An mobile app to check city weather
*/
import React, { Component } from 'react';
import { AppRegistry, Alert, Image } from 'react-native';
import { StackNavigator } from 'react-navigation';
import { RkButton } from 'react-native-ui-kitten';
import CityList from './CityList';
import CityDetails from './CityDetails';
import AppInfo from './AppInfo';
var APP = require('./app.json');
const Tweather = StackNavigator({
Home: {
screen: CityList,
navigationOptions: ({navigation}) => ({
title: APP.displayName,
headerRight: <RkButton
style={{backgroundColor: 'transparent', width: 50}}
onPress={() => navigation.navigate('Info')}>
<Image source={require('./res/img/info.png')} style={{width: 20, height: 20}} />
</RkButton>,
headerStyle: {
backgroundColor: '#31a1ce',
},
headerTintColor: 'white'
}),
},
Details: {
screen: CityDetails,
navigationOptions: ({navigation}) => ({
title: `${navigation.state.params.city.name} (${navigation.state.params.city.country})`,
headerStyle: {
backgroundColor: '#31a1ce',
},
headerTintColor: 'white'
}),
},
Info: {
screen: AppInfo,
navigationOptions: ({navigation}) => ({
title: `Tentang Aplikasi`,
headerStyle: {
backgroundColor: '#31a1ce',
},
headerTintColor: 'white'
}),
}
}, {
headerMode: 'screen'
});
AppRegistry.registerComponent('Tweather', () => Tweather);