Update: login

parent 50f8c0e6
import React from "react";
import { createStackNavigator } from "@react-navigation/stack";
import { Ionicons } from "@expo/vector-icons";
import { MaterialIcons } from '@expo/vector-icons';
import { SignIn } from "../screen/SignIn";
import { SignUp } from "../screen/SignUp";
import { HomeScreen } from "../screen/HomeScreen";
......@@ -30,6 +30,14 @@ export function AuthStack({ navigation }) {
);
},
headerLeftContainerStyle: { paddingLeft: 10 },
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......@@ -38,6 +46,14 @@ export function AuthStack({ navigation }) {
options={{
title: "Sign Up Page",
headerTitleAlign: "center",
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......@@ -46,6 +62,14 @@ export function AuthStack({ navigation }) {
options={{
title: "Agripreneurs",
headerTitleAlign: "center",
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......@@ -54,6 +78,14 @@ export function AuthStack({ navigation }) {
options={{
title: "Leaderboard Page",
headerTitleAlign: "center",
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......@@ -62,6 +94,14 @@ export function AuthStack({ navigation }) {
options={{
title: "Discounted/Price Page",
headerTitleAlign: "center",
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......@@ -70,6 +110,14 @@ export function AuthStack({ navigation }) {
options={{
title: "Gamification Page",
headerTitleAlign: "center",
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......
......@@ -92,9 +92,6 @@ export function PriceScreen({ navigation, data }) {
<TouchableOpacity>
<FontAwesome5 name="user-edit" size={30} color="black" />
</TouchableOpacity>
<TouchableOpacity>
<AntDesign name="logout" size={30} color="black" />
</TouchableOpacity>
</View>
<View style={styles.secondContainer}>
<View style={styles.SectionStyle}>
......
......@@ -23,7 +23,7 @@ export function SignIn({ navigation }) {
});
const textInputChange = (val) => {
if (val.trim().length >= 4) {
if (val.trim().length >= 4 && val.includes('@')) {
setData({
...data,
email: val,
......@@ -41,7 +41,7 @@ export function SignIn({ navigation }) {
};
const handlePasswordChange = (val) => {
if (val.trim().length >= 3) {
if (val.trim().length >= 4) {
setData({
...data,
password: val,
......@@ -93,7 +93,7 @@ export function SignIn({ navigation }) {
</View>
{data.isValidUser ? null : (
<Text style={styles.errorMsg}>
Email must be 4 characters long
Email must be 4 characters long and iclude @
</Text>
)}
</View>
......@@ -114,7 +114,7 @@ export function SignIn({ navigation }) {
</View>
{data.isValidPassword ? null : (
<Text style={styles.errorMsg}>
Password must be 6 characters long.
Password must be minimum 4 characters long.
</Text>
)}
</View>
......@@ -123,8 +123,6 @@ export function SignIn({ navigation }) {
style={styles.buttonSub}
activeOpacity={0.5}
onPress={() =>
axios.post("http://192.168.8.126:5000/login", form)
.then(function (response) {
const stngobj = JSON.stringify(response.data)
......@@ -135,6 +133,7 @@ export function SignIn({ navigation }) {
})
.catch(function (error) {
console.log(error);
alert("Login failed")
})
}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment