diff --git a/app/login.tsx b/app/login.tsx index 964f3c4..1b10972 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -1,3 +1,4 @@ +import { Text } from "@/src/components/primitive/Text"; import { AuthContext } from "@/src/context/AuthContext"; import { useContext, useState } from "react"; import { Button, TextInput, View } from "react-native"; @@ -6,10 +7,12 @@ export default function LoginPage() { const authCtx = useContext(AuthContext) const [handle, setHandle] = useState('') const [password, setPassword] = useState('') + const [status, setStatus] = useState<'none' | 'logged-in'>('none') - function onLogin() { - // authCtx.login(handle) - authCtx.loginWithPass(handle, password) + async function onLogin() { + // await authCtx.login(handle) + await authCtx.loginWithPass(handle, password) + setStatus('logged-in') } return ( @@ -17,6 +20,9 @@ export default function LoginPage() { + {status === 'logged-in' && ( + {"You're logged in!"} + )} ); }