Add react native js components
This commit is contained in:
committed by
Jannis Mattheis
parent
c3743cde25
commit
ea20a6418d
26
src/AuthLoading.js
Normal file
26
src/AuthLoading.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
AsyncStorage,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import SharedPreferences from 'react-native-shared-preferences';
|
||||
|
||||
export default class AuthLoadingScreen extends React.Component {
|
||||
componentDidMount() {
|
||||
SharedPreferences.getItem('@global:token', (token) => {
|
||||
this.props.navigation.navigate(token ? 'Messages' : 'Login');
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View >
|
||||
<ActivityIndicator />
|
||||
<StatusBar barStyle="default" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user