Ajout possibilité modifier son défi en cours

This commit is contained in:
2024-12-14 17:18:41 +01:00
parent 3348979738
commit 0f16edd8cc
5 changed files with 114 additions and 13 deletions

View File

@ -5,7 +5,7 @@ import { useAuth } from '@/hooks/useAuth'
import { useChallengeActions } from '@/hooks/useChallengeActions'
import { useChallenges } from '@/hooks/useChallenges'
import { useGame } from '@/hooks/useGame'
import { FontAwesome6 } from '@expo/vector-icons'
import { FontAwesome6, MaterialCommunityIcons } from '@expo/vector-icons'
import { useQueryClient } from '@tanstack/react-query'
import { useRouter } from 'expo-router'
import { useEffect, useMemo, useState } from 'react'
@ -91,10 +91,11 @@ function ChallengeScreenBody() {
style={{ flex: 1, margin: 20 }} />}
{!loading && !game.penaltyEnd && !currentChallenge && game.currentRunner && <>
<Banner
elevation={4}
visible={!currentChallenge && game.currentRunner && !loading}
icon='cancel'
style={{ backgroundColor: MD3Colors.error40 }}>
Aucun défi n'est en cours.
icon='vanish'>
Aucun défi n'est en cours. Veuillez tirer un défi en cliquant sur le bouton central.
Pour rappel, il faut être hors d'un train pour tirer un défi.
</Banner>
<View style={{ flexGrow: 1, justifyContent: 'center', alignItems: 'center' }}>
<FAB

View File

@ -68,7 +68,6 @@ export default function HistoryScreen() {
})
const gameRepairMutation = useGameRepairMutation({
auth,
updateGameState,
onPostSuccess: () => {
setSuccessVisible(true)
setSuccessMessage("Réparation du jeu effectuée avec succès")