This commit is contained in:
Milan Paunovic
2024-10-28 09:41:20 +01:00
parent 6fede24f89
commit 2c0a8a9392
4 changed files with 205 additions and 205 deletions

View File

@ -8,7 +8,7 @@ const Entry = () => {
const [tab, setTab] = useState<"register" | "login" | "reset-password">("login");
return (
<View>
<View style={{height:"100%"}}>
{tab === "register" && <SignUpPage setTab={setTab}/>}
{tab === "login" && <SignInPage setTab={setTab}/>}
{tab === "reset-password" && <ResetPasswordPage setTab={setTab}/>}

View File

@ -167,7 +167,7 @@ const SignInPage = ({
bottom
width="100%"
height="70%"
containerStyle={{ padding: 0 }}
containerStyle={{ padding: 15, backgroundColor:"white" }}
>
{hasPermission === null ? (
<Text>Requesting camera permissions...</Text>
@ -175,7 +175,7 @@ const SignInPage = ({
<Text>No access to camera</Text>
) : (
<CameraView
style={{ flex: 1 }}
style={{ flex: 1, borderRadius: 15 }}
onBarcodeScanned={handleQrCodeScanned}
barcodeScannerSettings={{
barcodeTypes: ["qr"],
@ -186,7 +186,7 @@ const SignInPage = ({
label="Cancel"
onPress={() => setShowCameraDialog(false)}
backgroundColor="#fd1775"
style={{ margin: 10 }}
style={{ margin: 10, marginBottom: 30 }}
/>
</Dialog>
</View>

View File

@ -1,4 +1,4 @@
import React, { useRef, useState } from "react";
import React, {useRef, useState} from "react";
import {
Button,
ButtonSize,
@ -9,14 +9,13 @@ import {
TouchableOpacity,
View,
} from "react-native-ui-lib";
import { useSignUp } from "@/hooks/firebase/useSignUp";
import { ProfileType } from "@/contexts/AuthContext";
import { Dimensions, StyleSheet } from "react-native";
import { AntDesign } from "@expo/vector-icons";
import {useSignUp} from "@/hooks/firebase/useSignUp";
import {StyleSheet} from "react-native";
import {AntDesign} from "@expo/vector-icons";
const SignUpPage = ({
setTab,
}: {
}: {
setTab: React.Dispatch<
React.SetStateAction<"register" | "login" | "reset-password">
>;
@ -29,18 +28,18 @@ const SignUpPage = ({
const [isPasswordVisible, setIsPasswordVisible] = useState<boolean>(false);
const [allowFaceID, setAllowFaceID] = useState<boolean>(false);
const [acceptTerms, setAcceptTerms] = useState<boolean>(false);
const { mutateAsync: signUp } = useSignUp();
const {mutateAsync: signUp} = useSignUp();
const lnameRef = useRef<TextFieldRef>(null);
const emailRef = useRef<TextFieldRef>(null);
const passwordRef = useRef<TextFieldRef>(null);
const handleSignUp = async () => {
await signUp({ email, password, firstName, lastName });
await signUp({email, password, firstName, lastName});
};
return (
<View padding-15 marginT-30 height={Dimensions.get("window").height} flexG>
<View height={"100%"} padding-15 marginT-30>
<Text style={styles.title}>Get started with Cally</Text>
<Text style={styles.subtitle} marginT-15 color="#919191">
Please enter your details.
@ -81,7 +80,7 @@ const SignUpPage = ({
/>
<View
centerV
style={[styles.textfield, { padding: 0, paddingHorizontal: 30 }]}
style={[styles.textfield, {padding: 0, paddingHorizontal: 30}]}
>
<TextField
ref={passwordRef}
@ -144,6 +143,7 @@ const SignUpPage = ({
</View>
</View>
</View>
<View flex-1/>
<View style={styles.bottomView}>
<Button
label="Register"
@ -152,10 +152,10 @@ const SignUpPage = ({
fontSize: 16,
}}
onPress={handleSignUp}
style={{ marginBottom: 0, backgroundColor: "#fd1775", height: 50 }}
style={{marginBottom: 0, backgroundColor: "#fd1775", height: 50}}
/>
<View row centerH marginT-10 marginB-2 gap-5>
<Text style={[styles.jakartaLight, { fontSize: 16, color: "#484848" }]} center>
<Text style={[styles.jakartaLight, {fontSize: 16, color: "#484848"}]} center>
Already have an account?
</Text>
@ -163,7 +163,7 @@ const SignUpPage = ({
label="Log in"
labelStyle={[
styles.jakartaMedium,
{ fontSize: 16, textDecorationLine: "none", color: "#fd1775" },
{fontSize: 16, textDecorationLine: "none", color: "#fd1775"},
]}
flexS
margin-0
@ -193,7 +193,7 @@ const styles = StyleSheet.create({
color: "#919191",
},
//mora da se izmeni kako treba
bottomView: { marginTop: "auto", marginBottom: 30 },
bottomView: {marginTop: "auto", marginBottom: 30, marginTop: "auto"},
jakartaLight: {
fontFamily: "PlusJakartaSans_300Light",
fontSize: 13,
@ -205,8 +205,8 @@ const styles = StyleSheet.create({
color: "#919191",
textDecorationLine: "underline",
},
title: { fontFamily: "Manrope_600SemiBold", fontSize: 34, marginTop: 50 },
subtitle: { fontFamily: "PlusJakartaSans_400Regular", fontSize: 16 },
title: {fontFamily: "Manrope_600SemiBold", fontSize: 34, marginTop: 50},
subtitle: {fontFamily: "PlusJakartaSans_400Regular", fontSize: 16},
check: {
borderRadius: 3,
aspectRatio: 1,

View File

@ -15,7 +15,7 @@ export const useCreateSubUser = () => {
return await functions().httpsCallable("createSubUser")({
...userProfile,
email,
familyId: profileData?.familyId
familyId: profileData?.familyId!
}) as HttpsCallableResult<{ userId: string }>
} else {
throw Error("Can't create sub-users as a non-parent.")