From a8dbe4e4f1b1ab3e0c33bff6572479fdf04bcc42 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Sun, 3 May 2026 15:08:36 +0200 Subject: [PATCH] login indicator --- app/login.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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!"} + )} ); } -- 2.51.2