2024-05-06 22:18:22 +02:00
|
|
|
import { Text, View } from "react-native";
|
|
|
|
|
|
|
|
import { useAuth } from "../context/AuthContext";
|
|
|
|
|
|
|
|
export default function Index() {
|
2024-05-08 16:31:21 +02:00
|
|
|
const { onLogout, authState } = useAuth();
|
|
|
|
|
|
|
|
const user = authState.user;
|
|
|
|
|
2024-05-06 22:18:22 +02:00
|
|
|
return (
|
|
|
|
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
2024-05-08 16:31:21 +02:00
|
|
|
<Text>Welcome {user.username}</Text>
|
2024-05-06 22:18:22 +02:00
|
|
|
<Text
|
|
|
|
onPress={() => {
|
|
|
|
// The `app/(app)/_layout.tsx` will redirect to the sign-in screen.
|
|
|
|
onLogout();
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
Sign Out
|
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|