import {
View,
Text,
TextInput,
SafeAreaView,
TextInputProps,
TouchableHighlight,
} from "react-native";
import React, { useState } from "react";
import tw from "twrnc";
import useAuthStore from "../../stores/useAuthStore";
import { useTicketMut } from "../../hooks/useTicket";
import {
DEFAUL_PVE_URL,
DEFAUL_PVE_USER,
DEFAUL_PVE_PASSWORD,
} from "react-native-dotenv";
interface FormFieldProps extends TextInputProps {
label: string;
}
export function FormField({
label,
value,
onChangeText,
placeholder,
secureTextEntry,
inputMode,
}: FormFieldProps) {
return (
<>
{label}
>
);
}
export default function Login() {
const [domain, setDomain] = useState(DEFAUL_PVE_URL ?? "");
const [username, setUsername] = useState(DEFAUL_PVE_USER ?? "");
const [password, setPassword] = useState(DEFAUL_PVE_PASSWORD ?? "");
const authStore = useAuthStore();
const ticketMut = useTicketMut({
onSuccess: ({ data: ticketData }) => {
console.log({ ticketData });
authStore.update({ domain, username, ticketData });
},
});
return (
PVERN
Sign In
ticketMut.mutate({ domain, username, password })}
>
Sign In
);
}