-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
45 lines (39 loc) · 1.06 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
import React from 'react';
import { StatusBar, ScrollView } from 'react-native';
import styled from 'styled-components/native';
import * as Font from 'expo-font';
import { globalStyles } from './src/constants';
import Home from './src/screen/Home';
class App extends React.Component {
state = {
fontLoaded: false
};
async componentDidMount() {
await Font.loadAsync({
'lato-black': require('./assets/fonts/Lato-Black.ttf'),
'lato-regular': require('./assets/fonts/Lato-Regular.ttf')
});
this.setState({ fontLoaded: true });
}
render() {
const { fontLoaded } = this.state;
if (!fontLoaded) return null;
return (
<Container>
<ScrollView
keyboardShouldPersistTaps='never'
showsVerticalScrollIndicator={false}
contentContainerStyle={{ flexGrow: 1 }}
>
<StatusBar barStyle='light-content' />
<Home />
</ScrollView>
</Container>
);
}
}
export default App;
const Container = styled.View`
flex: 1;
background: ${globalStyles.LIGHT_BG};
`;