-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
102 lines (83 loc) · 2.48 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Text,
View,
Button,
Image,
StyleSheet,
ToolbarAndroid,
} from 'react-native';
import { createStackNavigator, createDrawerNavigator } from 'react-navigation';
import Header from "./halaman/header";
import Footer from "./halaman/footer";
import Profil from "./halaman/profil";
import Berita from "./halaman/berita";
import About from "./halaman/about";
import Komponen from "./halaman/komponen";
import ManageBerita from "./halaman/manageberita";
class App extends Component {
state = {
judul: "UDB SURAKARTA"
}
static navigationOptions = {
drawerLabel: 'Home',
drawerIcon: ({ tintColor }) => (
<Image
source={require('./gambar/nav.png')}
style={[styles.icon, {tintColor: tintColor}]}
/>
),
};
render() {
const { navigate } = this.props.navigation;
return (
<View style={{flex: 1, flexDirection: 'column'}}>
<View style={{height: 70, backgroundColor: 'yellow'}}>
<ToolbarAndroid
logo={ require('./gambar/logo.png') }
navIcon={ require('./gambar/nav.png') }
title={this.state.judul}
style={styles.toolbar}
titleColor='white'
onIconClicked= {() => this.props.navigation.openDrawer() } />
</View>
<View style={{flex: 1, backgroundColor: 'white'}}>
<Text>Halaman Beranda</Text>
<Button title="Ke Profil" onPress={() => navigate('Profil') } />
</View>
<View style={{height: 50, backgroundColor: '#c0c0c0'}}>
<Footer konten="Universitas Duta Bangsa Surakarta @ 2018"/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
icon: {
width: 24,
height: 24,
},
toolbar: {
height: 56,
backgroundColor: '#4883da',
},
});
const AppNavigasi = createDrawerNavigator(
{
Beranda: { screen: App },
Profil: { screen: Profil },
Berita: { screen: Berita },
About: { screen: About },
Komponen: { screen: Komponen },
ManageBerita: { screen: ManageBerita},
},
{
intialRouteName: 'Beranda',
}
);
export default AppNavigasi;