updating login
This commit is contained in:
BIN
assets/icon.png
BIN
assets/icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 271 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 3.1 MiB |
@@ -1,8 +1,10 @@
|
|||||||
import { StatusBar } from 'expo-status-bar';
|
import { StatusBar } from 'expo-status-bar';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Text, View, TextInput, Button, StyleSheet } from 'react-native';
|
import { Text, View, StyleSheet, Image } from 'react-native';
|
||||||
|
import { TextInput, Button } from 'react-native-paper';
|
||||||
import API from './../API.js';
|
import API from './../API.js';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
|
import GlobalState from '../contexts/GlobalState.js';
|
||||||
|
|
||||||
|
|
||||||
let LoginForm = () => {
|
let LoginForm = () => {
|
||||||
@@ -12,7 +14,11 @@ let LoginForm = ()=>{
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.mainView}>
|
<View style={styles.mainView}>
|
||||||
<Text>Log in</Text>
|
<Image
|
||||||
|
style={styles.logo}
|
||||||
|
source={require('./../assets/icon.png')}
|
||||||
|
/>
|
||||||
|
<Text style={styles.header}>Login</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
onChangeText={text => setEmail(text)}
|
onChangeText={text => setEmail(text)}
|
||||||
@@ -21,6 +27,7 @@ let LoginForm = ()=>{
|
|||||||
autoCapitalize='none'
|
autoCapitalize='none'
|
||||||
autoComplete='email'
|
autoComplete='email'
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
|
mode="outlined"
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
@@ -32,14 +39,14 @@ let LoginForm = ()=>{
|
|||||||
autoCapitalize='none'
|
autoCapitalize='none'
|
||||||
autoComplete='email'
|
autoComplete='email'
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
|
mode="outlined"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
let r = await API.logIn(email, password);
|
let r = await API.logIn(email, password);
|
||||||
if (r.status === "ok") navigation.navigate('Feed');
|
if (r.status === "ok") navigation.navigate('Feed');
|
||||||
}}
|
}}
|
||||||
title={"login"}
|
>submit</Button>
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -48,16 +55,29 @@ export default LoginForm;
|
|||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
mainView: {
|
mainView: {
|
||||||
|
backgroundColor: 'white',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection:'column',
|
flexDirection: "column",
|
||||||
alignItems: 'center',
|
justifyContent: "flex-start",
|
||||||
|
padding: 15,
|
||||||
|
width: "100%",
|
||||||
|
alignContent: 'center'
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontFamily: 'Helvetica-Bold',
|
||||||
|
fontSize: 42,
|
||||||
|
textAlign: "left",
|
||||||
|
paddingBottom: 15,
|
||||||
|
color: '#777',
|
||||||
|
alignContent: 'center'
|
||||||
|
},
|
||||||
|
logo:{
|
||||||
|
width: 250,
|
||||||
|
height: 250,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
input:{
|
input:{
|
||||||
height: 40,
|
backgroundColor: 'white'
|
||||||
width: 300,
|
}
|
||||||
borderColor: 'gray',
|
|
||||||
borderWidth: 1,
|
|
||||||
margin: 10
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user