diff --git a/src/Routes/Register/Register.tsx b/src/Routes/Register/Register.tsx index e2a3297..34497c1 100644 --- a/src/Routes/Register/Register.tsx +++ b/src/Routes/Register/Register.tsx @@ -1,56 +1,72 @@ -import * as React from 'react'; -import {View, Text, TextInput} from 'react-native'; -import styles from '../../styles'; -import Background from '../../Components/Background/Background'; -import { SafeAreaView } from 'react-native-safe-area-context'; +import * as React from "react"; +import { View, Text, TextInput } from "react-native"; +import styles from "../../styles"; +import Background from "../../Components/Background/Background"; +import { SafeAreaView } from "react-native-safe-area-context"; import { useState } from "react"; -import {TouchableOpacity} from "react-native"; +import { TouchableOpacity } from "react-native"; +import { UserRegister } from "../../Components/Api/Api"; export default function Register() { const [username, setUsername] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [feedback, setFeedback] = useState(""); return ( - + - - Create an Account - - - + + Create an Account - - - - - - - REGISTER - - + + + + + + + + + { + setUsername(""); + setPassword(""); + console.log("heh"); + if (await UserRegister({ username, email, password })) { + setFeedback( + "Registration success. Please check your email address for activation" + ); + } else { + setFeedback("Invalid credentials specified"); + } + }} + style={styles.registerbtn} + > + REGISTER + + {feedback} + - ); }