traintrape-moi/client/app/(tabs)/settings.tsx

19 lines
670 B
TypeScript
Raw Normal View History

2024-12-09 21:57:59 +00:00
import * as SecureStore from '@/utils/SecureStore'
2024-12-09 21:29:48 +00:00
import { useRouter } from 'expo-router'
import { FAB, List, Surface } from 'react-native-paper'
export default function HistoryScreen() {
2024-12-09 21:29:48 +00:00
const router = useRouter()
const isLoggedIn = SecureStore.getItem("apiToken") !== null
return (
2024-12-09 21:29:48 +00:00
<Surface
style={{ flex: 1 }}>
<List.Item
title="Connexion au serveur"
description={isLoggedIn ? "Vous êtes déjà connecté⋅e" : "Vous n'êtes pas connecté⋅e"}
right={() => <FAB icon="login" size="small" onPress={() => router.navigate('/login')} />}
onPress={() => router.navigate('/login')} />
2024-12-09 20:00:15 +00:00
</Surface>
)
}