From db8a8b4b7bd92a28de3375026a71b0713b53bf38 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Thu, 12 Dec 2024 20:15:43 +0100 Subject: [PATCH] =?UTF-8?q?Gestion=20affichage=20d=C3=A9fi=20selon=20les?= =?UTF-8?q?=20cas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/app/(tabs)/challenges.tsx | 47 ++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/client/app/(tabs)/challenges.tsx b/client/app/(tabs)/challenges.tsx index 5369242..dafc085 100644 --- a/client/app/(tabs)/challenges.tsx +++ b/client/app/(tabs)/challenges.tsx @@ -3,10 +3,22 @@ import PenaltyBanner from '@/components/PenalyBanner' import { useChallengeActions } from '@/hooks/useChallengeActions' import { useChallenges } from '@/hooks/useChallenges' import { useGame } from '@/hooks/useGame' +import { FontAwesome6 } from '@expo/vector-icons' import { useMemo } from 'react' -import { Appbar, Surface } from 'react-native-paper' +import { View } from 'react-native' +import { Appbar, Banner, FAB, MD3Colors, Surface, Text } from 'react-native-paper' -export default function ChallengesScreen() { +function ChallengeScreenHeader() { + return <> + + + + + + +} + +function ChallengeScreenBody() { const game = useGame() const challengeActions = useChallengeActions() const challenges = useChallenges() @@ -21,14 +33,33 @@ export default function ChallengesScreen() { return challenges.challenges.find((challenge) => challenge.id === currentChallengeAction.challengeId) }, [currentChallengeAction, challenges]) + return <> + {currentChallenge && } + {!currentChallenge && game.currentRunner && <> + + Aucun défi en cours. + + + + + } + } + style={{ backgroundColor: MD3Colors.secondary30 }}> + Vous êtes poursuiveuse, et n'avez donc pas de défi à accomplir. + + +} + +export default function ChallengesScreen() { return ( - - - - - - {currentChallenge && } + + ) }