From 30b5a5e946389b01f7c5993e19105ea0e9874d30 Mon Sep 17 00:00:00 2001 From: Lucie Bedouret Date: Fri, 14 Oct 2022 11:43:52 +0200 Subject: [PATCH] =?UTF-8?q?ADD=20GoBackBar=20composant=20et=20navigation?= =?UTF-8?q?=20ompl=C3=A8te=20de=20la=20page=20GameChoice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bob_party/src/components/Element.tsx | 17 +++++++++-------- bob_party/src/components/GoBackBar.tsx | 22 ++++++++++++++++++++++ bob_party/src/screens/GameChoice.tsx | 21 ++++++++++++--------- bob_party/src/screens/Home.tsx | 2 +- bob_party/src/screens/Settings.tsx | 25 ++++++++++--------------- 5 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 bob_party/src/components/GoBackBar.tsx diff --git a/bob_party/src/components/Element.tsx b/bob_party/src/components/Element.tsx index 9eb98cb..cd70f93 100644 --- a/bob_party/src/components/Element.tsx +++ b/bob_party/src/components/Element.tsx @@ -22,22 +22,23 @@ FC<{element: any, styleImage: ImageStyle, styleTitle : TextStyle,nav: any}> = ) } - return( - - Type invalide pour ce composant - - ) - /*else if(element.type()==Game) + if(element instanceof Game) { return ( Alert.alert("Lancement du jeu")}> ) - }*/ + } + return( + + Type invalide pour ce composant + + ) + } \ No newline at end of file diff --git a/bob_party/src/components/GoBackBar.tsx b/bob_party/src/components/GoBackBar.tsx new file mode 100644 index 0000000..e30d964 --- /dev/null +++ b/bob_party/src/components/GoBackBar.tsx @@ -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 ( + + {title} + nav.goBack()}> + + + + ) +} \ No newline at end of file diff --git a/bob_party/src/screens/GameChoice.tsx b/bob_party/src/screens/GameChoice.tsx index 363bbbf..67088be 100644 --- a/bob_party/src/screens/GameChoice.tsx +++ b/bob_party/src/screens/GameChoice.tsx @@ -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 ( - + - - - Paramètres - props.navigation.goBack()}> - - - + couille