Created
November 13, 2019 05:24
-
-
Save aravi365/dc4628d657e11d64e2461a9104577666 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 {View, Text, ActivityIndicator, StyleSheet} from 'react-native'; | |
import firebase from 'react-native-firebase'; | |
export default class SplashPage extends React.Component { | |
componentDidMount() { | |
setTimeout(() => { | |
firebase.auth().onAuthStateChanged(user => { | |
this.props.navigation.navigate(user ? 'Home' : 'SignUp'); | |
}); | |
}, 1800); | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={{color: 'blue', fontSize: 40}}>Learn Firebase</Text> | |
<ActivityIndicator color="blue" size="large" /> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment