first commit in repo

This commit is contained in:
Adolfo Reyna
2022-03-05 20:51:45 -08:00
parent fe2ec54139
commit 195e8f11ef
4 changed files with 360 additions and 14 deletions

40
App.js
View File

@@ -1,21 +1,33 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import React, { useEffect, useState } from 'react';
import { StyleSheet, Text, View, TextInput } from 'react-native';
import API from './API.js';
import LoginForm from './components/Login.js';
import Feed from './components/Feed.js';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
let [isLoggedIn, setIsLoggedIn] = useState(false);
useEffect(async () => {
let r = await API.isLoggedIn();
setIsLoggedIn(r);
}, []);
return (
<View style={styles.container}>
<Text>EMI Social LOGO</Text>
{!isLoggedIn && <LoginForm />}
{isLoggedIn && <Feed />}
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});