push pour alban
continuous-integration/drone/push Build is failing Details

Persistance
Thomas Chazot 2 years ago
parent e89d09b95b
commit 2782dd0456

@ -10,6 +10,7 @@ import {
Alert,
} from 'react-native'
import { MANAGER_USER } from '../../../App';
import { useMatchStore } from '../../context/matchContext';
import { useUserStore } from '../../context/userContext';
import { Match } from '../../core/Match/match';
import { User } from '../../core/User/user';
@ -19,10 +20,13 @@ function CookieClicker(props: { navigation: any}){
const { navigation } = props
const GAMING_TIME=15;
const setUser = useUserStore((state) => state.setUser);
const resetMatch = useMatchStore((state) => state.resetMatch);
const [count, setCount] = useState(0);
const [money, setMoney] = useState(0);
@ -85,13 +89,11 @@ function CookieClicker(props: { navigation: any}){
let tmp: User | null;
tmp=MANAGER_USER.getCurrentUser();
if (tmp!=null){
/*
if (match.getTabUsers().includes(tmp)){
match.updatePostMatch(tmp, count);
setUser(tmp);
if (useMatchStore().match?.getTabUsers().includes(tmp)){
useMatchStore().match?.updatePostMatch(tmp, count);
setUser(tmp);
}
*/
resetMatch();
navigation.goBack();
}
}

@ -13,6 +13,7 @@ import { useSelector } from "react-redux"
import { RootState } from "../redux/store"
import { MANAGER_USER } from "../../App"
import { useUserStore } from "../context/userContext"
import { useMatchStore } from "../context/matchContext"
/*
Images required
@ -32,6 +33,9 @@ FC<{nav: any, state?: string}> =
({nav, state}) =>
{
const resetMatch = useMatchStore((state) => state.resetMatch);
/* The display of this component depends of the screen from where it has been called:
* From the Settings (icon) : Name of the page + cross button
* From other : skin + Title + parameters icon
@ -49,6 +53,19 @@ FC<{nav: any, state?: string}> =
</Pressable>
</View>
)
case 'matchmacking':
return (
<View style={styles.header}>
<Pressable>
<Image source={msc} style={styles.icon}/>
</Pressable>
<Text style={styles.titre}>BOB PARTY</Text>
<Pressable onPress={() => { resetMatch(); nav.goBack()}}>
<Image source={cross} style={styles.icon}/>
</Pressable>
</View>
)
default:
return (

@ -1,5 +1,5 @@
import { StatusBar } from 'expo-status-bar'
import { View} from 'react-native'
import { View, Image} from 'react-native'
import React from 'react';
import stylesScreen from './style/screens.style'
import { TopBar } from '../components/TopBar';
@ -10,9 +10,6 @@ import { MANAGER_MATCH } from '../../App';
import { useMatchStore } from '../context/matchContext';
let tabConv:Conversation[]=[];
function LobbySolo(props: { navigation: any; }) {
const { navigation } = props
@ -21,16 +18,20 @@ function LobbySolo(props: { navigation: any; }) {
return (
<View style={stylesScreen.container}>
<View style={stylesScreen.bodyCenter}>
<ButtonGameTypeChoice
title='Lancer la partie'
onPress={() => navigation.navigate('GameChoice')}
<TopBar
nav={navigation}
state='matchmacking'
/>
<View style={stylesScreen.bodyCenter}>
<ButtonGameTypeChoice
title='Lancer la partie'
onPress={() => navigation.navigate('GameChoice')}
/>
</View>
<Image
source={{uri: match.getGame().getImageSource()}}
/>
source={{uri: match?.getGame().getImageSource()}}
/>
</View>
);
}

Loading…
Cancel
Save