ADD: Navigation jeu
continuous-integration/drone/push Build is failing Details

Persistance
Alban GUILHOT 2 years ago
parent 21cf294164
commit ac9440bfe2

@ -33,7 +33,7 @@ FC<{game: Game, nav: any}> =
let match=await m.createMatch(tmp, game); let match=await m.createMatch(tmp, game);
MANAGER_MATCH.setCurrentMatch(match); MANAGER_MATCH.setCurrentMatch(match);
setMatch(match); setMatch(match);
nav.navigate("LobbySolo"); nav.navigate("GameSolo");
} }
} }

@ -13,7 +13,7 @@ import GameChoice from '../screens/GameChoice'
import SignIn from '../screens/SignIn' import SignIn from '../screens/SignIn'
import SignUp from '../screens/SignUp' import SignUp from '../screens/SignUp'
import LobbySolo from '../screens/LobbySolo' import LobbySolo from '../screens/LobbySolo'
import CookieClicker from '../Games/CookieClicker/cookieClicker'
const HomeStack = createStackNavigator(); const HomeStack = createStackNavigator();
@ -78,13 +78,26 @@ const GameChoiceStack = createStackNavigator();
*/ */
function GameChoiceStackScreen() { function GameChoiceStackScreen() {
return ( return (
<ProfileStack.Navigator screenOptions={{headerShown: false}}> <GameChoiceStack.Navigator screenOptions={{headerShown: false}}>
<HomeStack.Screen name='GameChoice' component={GameChoice} options={{animationEnabled: false,}}/> <GameChoiceStack.Screen name='GameChoice' component={GameChoice} options={{animationEnabled: false,}}/>
<ProfileStack.Screen name="LobbySolo" component={LobbySolo} options={{animationEnabled: false,}}/> <GameChoiceStack.Screen name='GameSolo' component={GameSoloStackScreen} options={{animationEnabled: false,}}/>
</ProfileStack.Navigator> </GameChoiceStack.Navigator>
); );
} }
const GameSoloStack = createStackNavigator();
/*
Stack of screens for the profile and the changement of informations
*/
function GameSoloStackScreen() {
return (
<GameSoloStack.Navigator screenOptions={{headerShown: false}}>
<GameSoloStack.Screen name='LobbySolo' component={LobbySolo} options={{animationEnabled: false,}}/>
<GameSoloStack.Screen name='CookieClicker' component={CookieClicker} />
</GameSoloStack.Navigator>
);
}
const Tab = createBottomTabNavigator() const Tab = createBottomTabNavigator()
/* /*

@ -25,11 +25,12 @@ function LobbySolo(props: { navigation: any; }) {
<View style={stylesScreen.bodyCenter}> <View style={stylesScreen.bodyCenter}>
<ButtonGameTypeChoice <ButtonGameTypeChoice
title='Lancer la partie' title='Lancer la partie'
onPress={() => navigation.navigate('GameChoice')} onPress={() => navigation.navigate(match?.getGame().getName().replace(/\s/g, ''))}
/> />
</View> </View>
<Image <Image
style={{width:100, height:100}}
source={{uri: match?.getGame().getImageSource()}} source={{uri: match?.getGame().getImageSource()}}
/> />
</View> </View>

Loading…
Cancel
Save