Files
EMI-ExpoAPP/Views/Login.js
2023-01-25 14:41:48 -05:00

38 lines
1010 B
JavaScript

import { StatusBar } from 'expo-status-bar';
import React, { useEffect, useState } from 'react';
import { StyleSheet, Text, View, TextInput, SafeAreaView } from 'react-native';
import API from './../API.js';
import LoginForm from './../components/Login.js';
export default function App({ navigation, route }) {
useEffect(() => {
getData = async () => {
let r = await API.isLoggedIn();
if (r) {
await API.logout();
navigation.navigate('Login')
}
}
getData();
return () => {
}
}, []);
return (
<SafeAreaView style={styles.container}>
<LoginForm />
<StatusBar style="auto" />
<View style={{ position: "absolute", top: 30, left: 10, opacity: 0.5 }}>
<Text>{"<- Not an EMI family memeber?"}</Text>
</View>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});