ADD GoBackBar composant et navigation omplète de la page GameChoice

stub-api
Lucie Bedouret 3 years ago
parent c7b1fb840b
commit 30b5a5e946

@ -22,22 +22,23 @@ FC<{element: any, styleImage: ImageStyle, styleTitle : TextStyle,nav: any}> =
</View>
)
}
return(
<View>
<Text>Type invalide pour ce composant</Text>
</View>
)
/*else if(element.type()==Game)
if(element instanceof Game)
{
return (
<View>
<Pressable onPress={() => Alert.alert("Lancement du jeu")}>
<Image
style={style}
style={styleImage}
source={element.getImageSource()}
/>
</Pressable>
</View>
)
}*/
}
return(
<View>
<Text>Type invalide pour ce composant</Text>
</View>
)
}

@ -0,0 +1,22 @@
import { FC, ReactNode } from "react"
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
import { Skin } from "../core/Skin"
import React from "react"
import { SkinComponent } from "./skinAvatar"
import MainTabNavigator from "../navigation/AppNavigator"
import { BottomTabNavigationProp } from "@react-navigation/bottom-tabs"
export const GoBackBar :
FC<{title: String, rightIcon: ImageSourcePropType, styleIcon: ImageStyle, nav: any, styleTitle: TextStyle, styleHeader : any}> =
({title, rightIcon, styleIcon, nav, styleTitle, styleHeader}) =>
{
return (
<View style={styleHeader}>
<Text style={styleTitle}>{title}</Text>
<Pressable onPress={() => nav.goBack()}>
<Image source={rightIcon} style={styleIcon}/>
</Pressable>
</View>
)
}

@ -5,10 +5,13 @@ import { Skin } from '../core/skin';
import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
import { ElementAffichage } from '../components/Element';
import { GoBackBar } from '../components/GoBackBar';
const msc = require('../../assets/Icons/FondGris.png');
const avatar = require('../../assets/Icons/BobClassic.png');
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const jeuTest= new Game("SNAKE", require('../../assets/Icons/UnSelected/Gamepad.png',"dublablapourlinstant"))
const cross = require('../../assets/Icons/UnSelected/Cross.png');
const gamepad = require('../../assets/Icons/Selected/SGamepad.png');
const message = require('../../assets/Icons/UnSelected/Chat.png');
const store = require('../../assets/Icons/UnSelected/Store.png');
@ -17,14 +20,14 @@ function GameChoice(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<TopBar
skin={skinTest}
styleAvatar={styles.avatar}
title="JOUONS !"
rightIcon={engrenage}
styleIcon={styles.engrenage}
nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
/>
<GoBackBar
title="JOUONS !"
styleTitle={styles.titre}
styleHeader={styles.header}
styleIcon={styles.engrenage}
rightIcon={cross}
nav={navigation}
/>
<View style={styles.body}>
<ElementAffichage
element={skinTest}

@ -17,7 +17,7 @@ const skinTest2= new Skin("wesh",require('../../assets/BobsSkins/BobBlue.png'));
tabSkin=[skinTest];
tabSkin.push(skinTest2);
let tabConv:Conversation[]=[];
const UserActu=new User("14", "leBg", "ouioui", "grand", "la", 12222, 123324, skinTest, tabSkin, tabConv);
const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, skinTest, tabSkin, tabConv);
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const gamepad = require('../../assets/Icons/Selected/SGamepad.png');
const message = require('../../assets/Icons/UnSelected/Chat.png');

@ -1,27 +1,22 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react';
import { GoBackBar } from '../components/GoBackBar';
const msc = require('../../assets/Icons/FondGris.png');
const engrenage = require('../../assets/Icons/UnSelected/Cross.png');
const cross = require('../../assets/Icons/UnSelected/Cross.png');
function Store(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Image
style={styles.engrenage}
source={msc}
/>
<Text style={styles.titre}>Paramètres</Text>
<Pressable onPress={() => props.navigation.goBack()}>
<Image
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
</View>
<GoBackBar
title="Paramètres"
styleTitle={styles.titre}
styleHeader={styles.header}
styleIcon={styles.engrenage}
rightIcon={cross}
nav={navigation}
/>
<View style={styles.body}>
<Text style={styles.text}>couille</Text>
</View>

Loading…
Cancel
Save