mirror of
https://github.com/urosran/cally.git
synced 2025-11-27 17:04:55 +00:00
Event creation
This commit is contained in:
@ -1,41 +1,49 @@
|
||||
import { View, Text, Button } from "react-native-ui-lib";
|
||||
import { TextInput } from "react-native";
|
||||
import { View, Text, Button, TextField } from "react-native-ui-lib";
|
||||
import React, { useState } from "react";
|
||||
import { useSignIn } from "@/hooks/firebase/useSignIn";
|
||||
|
||||
const SignInPage = (props: {
|
||||
setRegister: () => any;
|
||||
}) => {
|
||||
const [email, setEmail] = useState<string>("");
|
||||
const [password, setPassword] = useState<string>("");
|
||||
const SignInPage = (props: { setRegister: () => any }) => {
|
||||
const [email, setEmail] = useState<string>("");
|
||||
const [password, setPassword] = useState<string>("");
|
||||
|
||||
const { mutateAsync: signIn } = useSignIn();
|
||||
const { mutateAsync: signIn, error, isError } = useSignIn();
|
||||
|
||||
const handleSignIn = async () => {
|
||||
await signIn({email, password});
|
||||
}
|
||||
const handleSignIn = async () => {
|
||||
await signIn({ email, password });
|
||||
};
|
||||
|
||||
return (
|
||||
<View marginH-20>
|
||||
<TextInput placeholder="Email" value={email} onChangeText={setEmail} />
|
||||
<TextInput
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChangeText={setPassword}
|
||||
secureTextEntry
|
||||
/>
|
||||
<Button label="Login" onPress={handleSignIn} />
|
||||
<Text>Don't have an account?</Text>
|
||||
<Button
|
||||
onPress={props.setRegister}
|
||||
label="Sign Up"
|
||||
link
|
||||
padding-0
|
||||
margin-0
|
||||
left
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
return (
|
||||
<View padding-10>
|
||||
<TextField
|
||||
placeholder="Email"
|
||||
value={email}
|
||||
onChangeText={setEmail}
|
||||
style={{ marginBottom: 10 }}
|
||||
floatingPlaceholder
|
||||
/>
|
||||
<TextField
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChangeText={setPassword}
|
||||
secureTextEntry
|
||||
style={{ marginBottom: 10 }}
|
||||
floatingPlaceholder
|
||||
/>
|
||||
<Button label="Login" onPress={handleSignIn} style={{ marginBottom: 20 }} />
|
||||
{isError && (
|
||||
<Text center style={{ marginBottom: 20 }}>{`${error}`}</Text>
|
||||
)}
|
||||
<Text center style={{ marginBottom: 5 }}>Don't have an account?</Text>
|
||||
<Button
|
||||
onPress={props.setRegister}
|
||||
label="Sign Up"
|
||||
link
|
||||
padding-0
|
||||
margin-0
|
||||
left
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default SignInPage;
|
||||
|
||||
Reference in New Issue
Block a user