-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.js
39 lines (32 loc) · 1.08 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
import React from 'react'
import Main from './app/Main.js'
import * as Font from 'expo-font'
import EStyleSheet from 'react-native-extended-stylesheet';
export default class App extends React.Component {
state = {
fontLoaded: false,
};
async componentDidMount() {
await Font.loadAsync({
'open-sans-bold': require('./app/assets/fonts/OpenSans/OpenSans-Bold.ttf'),
'open-sans-regular': require('./app/assets/fonts/OpenSans/OpenSans-Regular.ttf'),
'open-sans-semibold': require('./app/assets/fonts/OpenSans/OpenSans-SemiBold.ttf'),
'open-sans-extrabold': require('./app/assets/fonts/OpenSans/OpenSans-ExtraBold.ttf')
});
this.setState({ fontLoaded: true });
}
render() {
return (
this.state.fontLoaded ? (
<Main/>
) : null
);
}
}
EStyleSheet.build({ // always call EStyleSheet.build() even if you don't use global variables!
$textColor: '#0275d8',
$openSansBold: 'open-sans-bold',
$openSansRegular: 'open-sans-regular',
$openSansSemibold: 'open-sans-semibold',
$openSansExtrabold: 'open-sans-extrabold',
})