-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
53 lines (45 loc) · 1.21 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
import React, { Component } from "react";
import { Platform, StyleSheet, NavigatorIOS, UIManager } from "react-native";
import { COLOR, ThemeProvider, Subheader } from "react-native-material-ui";
import Home from "./Home";
UIManager.setLayoutAnimationEnabledExperimental &&
UIManager.setLayoutAnimationEnabledExperimental(true);
const uiTheme = {
palette: {
primaryColor: COLOR.green500
},
toolbar: {
container: {
height: 50
}
}
};
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
navigationBarHidden: false
};
}
toggleNavigationBar = () => {
this.setState({ navigationBarHidden: !this.state.navigationBarHidden });
};
render() {
const { navigationBarHidden } = this.state;
const { toggleNavigationBar } = this;
return (
<ThemeProvider uiTheme={uiTheme}>
<NavigatorIOS
initialRoute={{
component: Home,
title: "DTube",
navigationBarHidden: navigationBarHidden,
passProps: { toggleNavigationBar: toggleNavigationBar }
}}
style={{ flex: 1 }}
/>
</ThemeProvider>
);
}
}
const styles = StyleSheet.create({});