Amélioration Géolocalisation
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
import { useGameRepairMutation, useGameResetMutation, useGameStartMutation, useGameStopMutation, useGameSwitchPlayerMutation } from '@/hooks/mutations/useGameMutation'
|
||||
import { useAuth } from '@/hooks/useAuth'
|
||||
import { useGame, useUpdateGameState } from '@/hooks/useGame'
|
||||
import { useGame, useSetLocationAccuracy, useUpdateGameState } from '@/hooks/useGame'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import { useRouter } from 'expo-router'
|
||||
import { useState } from 'react'
|
||||
import { Button, Dialog, FAB, List, MD3Colors, Portal, Snackbar, Surface, Text } from 'react-native-paper'
|
||||
import { Button, Dialog, List, MD3Colors, Portal, Snackbar, Surface, Text } from 'react-native-paper'
|
||||
import { Dropdown } from 'react-native-paper-dropdown'
|
||||
import { Accuracy } from 'expo-location'
|
||||
|
||||
export default function HistoryScreen() {
|
||||
const [successVisible, setSuccessVisible] = useState(false)
|
||||
@ -17,6 +19,17 @@ export default function HistoryScreen() {
|
||||
const auth = useAuth()
|
||||
const game = useGame()
|
||||
const updateGameState = useUpdateGameState()
|
||||
const setLocationAccuracy = useSetLocationAccuracy()
|
||||
|
||||
const accuracyArrayList = [
|
||||
{ value: Accuracy.BestForNavigation.toString(), label: "Navigation" },
|
||||
{ value: Accuracy.Highest.toString(), label: "Plus haute" },
|
||||
{ value: Accuracy.High.toString(), label: "Haute" },
|
||||
{ value: Accuracy.Balanced.toString(), label: "Équilibrée" },
|
||||
{ value: Accuracy.Low.toString(), label: "Basse" },
|
||||
{ value: Accuracy.Lowest.toString(), label: "Plus basse" },
|
||||
{ value: 'null', label: "Désactivée" },
|
||||
]
|
||||
|
||||
const gameStartMutation = useGameStartMutation({
|
||||
auth,
|
||||
@ -112,6 +125,11 @@ export default function HistoryScreen() {
|
||||
description={auth.loggedIn ? "Vous êtes déjà connecté⋅e" : "Vous n'êtes pas connecté⋅e"}
|
||||
right={() => <List.Icon icon="login" />}
|
||||
onPress={() => router.navigate('/login')} />
|
||||
<List.Item
|
||||
key={"location-accuracy"}
|
||||
title="Précision de la géolocalisation"
|
||||
description="Réglez le niveau de précision de la géolocalisation. Une valeur élevée indique une consommation de batterie accrue."
|
||||
right={() => <Dropdown label={"Géolocalisation"} hideMenuHeader={true} options={accuracyArrayList} value={game.settings.locationAccuracy?.toString() ?? 'null'} onSelect={(value) => setLocationAccuracy(!value || value == 'null' ? null : +value)} />} />
|
||||
</List.Section>
|
||||
<List.Section title={"Gestion du jeu"}>
|
||||
<List.Item
|
||||
|
Reference in New Issue
Block a user