-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathApp.js
More file actions
55 lines (47 loc) · 1.29 KB
/
App.js
File metadata and controls
55 lines (47 loc) · 1.29 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
48
49
50
51
52
53
54
55
import React from 'react';
import HomePage from './src/HomePage';
import { AppLoading } from 'expo';
import { Container, Drawer, StyleProvider } from 'native-base';
import * as Font from 'expo-font';
import { Ionicons } from '@expo/vector-icons';
import SideBar from './src/SideBar';
import getTheme from './native-base-theme/components';
import material from './native-base-theme/variables/material';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
isReady: false,
};
}
async componentDidMount() {
await Font.loadAsync({
Roboto: require('native-base/Fonts/Roboto.ttf'),
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
...Ionicons.font,
});
this.setState({ isReady: true });
}
closeDrawer() {
this.drawer._root.close()
};
openDrawer = () => {
this._drawer._root.open()
};
render() {
if (!this.state.isReady) {
return <AppLoading />;
}
return (
<StyleProvider style={getTheme(material)} >
<Drawer
ref={(ref) => { this._drawer = ref; }}
content={<SideBar />} >
<Container>
<HomePage openDrawer={this.openDrawer.bind(this)} />
</Container>
</Drawer>
</StyleProvider>
);
}
}