Created
August 3, 2018 10:54
-
-
Save awareness481/ae0e1401d2bfd35171c70daa756c367f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
ImageBackground, | |
StyleSheet, | |
Text, | |
TouchableHighlight, | |
View | |
} from 'react-native'; | |
import { Font } from 'expo'; | |
const background = require('./assets/bg.jpeg'); | |
export default class App extends React.Component { | |
constructor(props) { | |
super(props); | |
state = { | |
fontLoaded: false, | |
} | |
} | |
onButtonPress = () => { | |
console.log('hello'); | |
} | |
async componentDidMount() { | |
await Font.loadAsync({ | |
'source400': require('./assets/fonts/SourceSansPro-Regular.ttf'), | |
}); | |
this.setState({ fontLoaded: true }); | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<ImageBackground | |
source={background} | |
style={{width: '100%', height: '100%'}} | |
> | |
<TouchableHighlight | |
style={styles.button} | |
onPress={this.onButtonPress} | |
> | |
{ this.state.fontLoaded | |
? (<Text style={styles.touchText}> Get Started ────────></Text>) | |
: null | |
} | |
</TouchableHighlight> | |
</ImageBackground> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment