Structure de défi

This commit is contained in:
Emmy D'Anello 2024-12-12 18:01:08 +01:00
parent e623dad81f
commit 9c7a447e4e
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 32 additions and 6 deletions

View File

@ -25,8 +25,8 @@ export default function TabLayout() {
<Tabs.Screen
name="challenges"
options={{
title: 'Challenges',
headerTitleStyle: {fontSize: 32},
title: 'Défis',
headerShown: false,
tabBarIcon: ({ color }) => <FontAwesome6 name="coins" size={24} color={color} />,
}}
/>

View File

@ -1,9 +1,35 @@
import { Surface, Text } from 'react-native-paper'
import { FontAwesome6 } from '@expo/vector-icons'
import { View } from 'react-native'
import { Appbar, Button, Card, Surface, Text } from 'react-native-paper'
export default function ChallengesScreen() {
return (
<Surface>
<Text>Ici on aura la gestion des challenges</Text>
<Surface style={{ flex: 1 }}>
<Appbar.Header>
<Appbar.Content title={"Défis"} />
<Appbar.Action icon='format-list-bulleted' />
</Appbar.Header>
<Surface elevation={2} style={{ flex: 1, margin: 20, borderRadius: 20 }}>
<View style={{ padding: 10 }}>
<Text variant='headlineMedium' style={{ textAlign: 'center' }}>Titre</Text>
</View>
<View style={{ flexGrow: 1 }}>
<Surface elevation={5} mode='flat' style={{ flexGrow: 1, padding: 15 }}>
<Text variant='bodyLarge' style={{ flexGrow: 1 }}>Description</Text>
<Text variant='titleMedium'>
Récompense : 500 <FontAwesome6 name='coins' />
</Text>
</Surface>
</View>
<View style={{ flexWrap: 'wrap', flexDirection: 'row', justifyContent: 'space-around', padding: 15 }}>
<Button mode='outlined' icon='cancel'>
Passer
</Button>
<Button mode='contained' icon='check'>
Terminer
</Button>
</View>
</Surface>
</Surface>
)
}

View File

@ -43,7 +43,7 @@ export default function GameProvider({ children }: { children: ReactNode }) {
queryFn: () => fetch(`${process.env.EXPO_PUBLIC_TRAINTRAPE_MOI_SERVER}/trains/?playerId=${game.playerId}&size=10000`, {
headers: { "Authorization": `Bearer ${auth.token}` }}
).then(resp => resp.json()),
enabled: isAuthValid(auth) && !game.playerId,
enabled: isAuthValid(auth) && !!game.playerId,
refetchInterval: 5000,
})
useEffect(() => {