forked from nathvarun/Everything-Expo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
44 lines (41 loc) · 1.17 KB
/
App.js
File metadata and controls
44 lines (41 loc) · 1.17 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
import React from 'react';
import { StyleSheet, View, ActivityIndicator } from 'react-native';
import { Font } from 'expo';
import Text from './components/CustomText';
export default class App extends React.Component {
constructor() {
super();
this.state = {
fontLoaded: false
};
}
async componentDidMount() {
await Font.loadAsync({
'Raleway-Black': require('./assets/fonts/Raleway-Black.ttf'),
'Raleway-Bold': require('./assets/fonts/Raleway-Bold.ttf'),
'Raleway-SemiBold': require('./assets/fonts/Raleway-SemiBold.ttf'),
'Raleway-Medium': require('./assets/fonts/Raleway-Medium.ttf'),
'Raleway-Regular': require('./assets/fonts/Raleway-Regular.ttf')
});
this.setState({ fontLoaded: true });
}
render() {
return (
<View style={styles.container}>
{this.state.fontLoaded ? (
<Text type="bold">Open up App.js to start working on your app!</Text>
) : (
<ActivityIndicator size="large" />
)}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center'
}
});