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

19 lines
665 B
TypeScript

import SecureStore from '@/utils/SecureStore'
import { useRouter } from 'expo-router'
import { FAB, List, Surface } from 'react-native-paper'
export default function HistoryScreen() {
const router = useRouter()
const isLoggedIn = SecureStore.getItem("apiToken") !== null
return (
<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')} />
</Surface>
)
}