Skip to content

Instantly share code, notes, and snippets.

@aravi365
Created November 13, 2019 05:24
Show Gist options
  • Save aravi365/dc4628d657e11d64e2461a9104577666 to your computer and use it in GitHub Desktop.
Save aravi365/dc4628d657e11d64e2461a9104577666 to your computer and use it in GitHub Desktop.
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