From bf070e09bf03af17cd1f9343f216c0e4b33e16d2 Mon Sep 17 00:00:00 2001 From: Lucie Bedouret Date: Fri, 14 Oct 2022 11:17:56 +0200 Subject: [PATCH] =?UTF-8?q?ADD=20composant=20jeu/skin=20et=20de=20la=20pag?= =?UTF-8?q?e=20(non=20termin=C3=A9e)=20de=20GameChoice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bob_party/src/components/Element.tsx | 43 + bob_party/src/components/TopBar.tsx | 4 +- bob_party/src/navigation/AppNavigator.tsx | 2 + bob_party/src/screens/Chat.tsx | 2 +- bob_party/src/screens/GameChoice.tsx | 163 + bob_party/src/screens/Home.tsx | 4 +- bob_party/src/screens/Profile.tsx | 2 +- bob_party/src/screens/Store.tsx | 25 +- bob_party/yarn.lock | 12890 ++++++++++---------- 9 files changed, 6600 insertions(+), 6535 deletions(-) create mode 100644 bob_party/src/components/Element.tsx create mode 100644 bob_party/src/screens/GameChoice.tsx diff --git a/bob_party/src/components/Element.tsx b/bob_party/src/components/Element.tsx new file mode 100644 index 0000000..9eb98cb --- /dev/null +++ b/bob_party/src/components/Element.tsx @@ -0,0 +1,43 @@ +import { FC, ReactNode } from "react" +import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native" +import React from "react" +import { Skin } from "../core/skin" +import { trace } from "console" + +export const ElementAffichage : +FC<{element: any, styleImage: ImageStyle, styleTitle : TextStyle,nav: any}> = +({element, styleImage, styleTitle, nav}) => +{ + if (element instanceof Skin) + { + return( + + Alert.alert("Achat du skin")}> + + {element.getSkinName()} + + + ) + } + return( + + Type invalide pour ce composant + + ) + /*else if(element.type()==Game) + { + return ( + + Alert.alert("Lancement du jeu")}> + + + + ) + }*/ +} \ No newline at end of file diff --git a/bob_party/src/components/TopBar.tsx b/bob_party/src/components/TopBar.tsx index 869443f..d9a37c9 100644 --- a/bob_party/src/components/TopBar.tsx +++ b/bob_party/src/components/TopBar.tsx @@ -7,7 +7,9 @@ import MainTabNavigator from "../navigation/AppNavigator" import { BottomTabNavigationProp } from "@react-navigation/bottom-tabs" -export const TopBar : FC<{skin: Skin, styleAvatar: ImageStyle, title: String, rightIcon: ImageSourcePropType, styleIcon: ImageStyle,nav: any, styleTitle: TextStyle, styleHeader : any}> = ({skin, styleAvatar, title, rightIcon,styleIcon, nav, styleTitle, styleHeader}) => +export const TopBar : +FC<{skin: Skin, styleAvatar: ImageStyle, title: String, rightIcon: ImageSourcePropType, styleIcon: ImageStyle,nav: any, styleTitle: TextStyle, styleHeader : any}> = +({skin, styleAvatar, title, rightIcon, styleIcon, nav, styleTitle, styleHeader}) => { return ( diff --git a/bob_party/src/navigation/AppNavigator.tsx b/bob_party/src/navigation/AppNavigator.tsx index d5836c5..d473fb3 100644 --- a/bob_party/src/navigation/AppNavigator.tsx +++ b/bob_party/src/navigation/AppNavigator.tsx @@ -8,6 +8,7 @@ import Store from '../screens/Store' import Chat from '../screens/Chat' import Settings from '../screens/Settings' import Profile from '../screens/Profile' +import GameChoice from '../screens/GameChoice' import Test from '../screens/Test' @@ -20,6 +21,7 @@ function HomeStackScreen() { + ); } diff --git a/bob_party/src/screens/Chat.tsx b/bob_party/src/screens/Chat.tsx index b70abed..c3c1a12 100644 --- a/bob_party/src/screens/Chat.tsx +++ b/bob_party/src/screens/Chat.tsx @@ -19,7 +19,7 @@ function Chat(props: { navigation: any; }) { + + + + + + + ); +} + + +function Button(props: { onPress: any; title?: any | undefined; }) { + const { onPress, title = 'Save' } = props; + return ( + + {title} + + ); +} + + +const styles = StyleSheet.create({ + body: { + flex: 1, + flexDirection: 'column', + alignItems: 'flex-start', + width: '70%', + }, + + container: { + flex: 1, + backgroundColor: "#45444E", + flexDirection: "column", + justifyContent: "flex-start", + alignItems: "center", + }, + button: { + alignItems: 'center', + justifyContent: 'center', + height: '30%', + width: '100%', + marginTop: '10%', + paddingVertical: 12, + paddingHorizontal: 32, + borderRadius: 10, + elevation: 3, + backgroundColor: '#0085FF', + }, + text: { + fontSize: 16, + lineHeight: 21, + fontWeight: 'bold', + letterSpacing: 0.25, + color: 'white', + }, + header: { + flex : 0.15, + width: '100%', + flexDirection: 'row', + backgroundColor: '#2D2C33', + alignItems: 'center', + justifyContent: 'space-around', + }, + titre: { + flex: 0.7, + flexDirection: 'column', + textAlign: 'center', + fontSize: 30, + fontFamily: 'Helvetica', + fontWeight: 'bold', + letterSpacing: 0.25, + color: 'white', + }, + engrenage: { + borderRadius: 50, + width: 50, + height: 50, + }, + avatar: { + borderRadius: 50, + width: 50, + height: 50, + }, + + footer: { + flex: 0.15, + flexDirection: 'row', + backgroundColor: '#2D2C33', + flexWrap: 'wrap', + width: '100%', + justifyContent: 'space-evenly', + }, + iconFooter: { + marginBottom: 25, + marginTop: 10, + width: 65, + height: 50, + }, + iconStore: { + marginBottom: 25, + marginTop: 10, + marginLeft: 7, + marginRight: 8, + width: 50, + height: 50, + }, + imageSkin : { + borderRadius: 15, + marginTop: 15, + marginRight: 15, + width: 100, + height: 100, + }, + nomSkin :{ + textAlign: 'center', + fontSize: 15, + fontFamily: 'Helvetica', + fontWeight: 'bold', + letterSpacing: 0.25, + color: 'white', + }, + +}); + +export default GameChoice \ No newline at end of file diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index 20b8008..9dd1349 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -39,11 +39,11 @@ function Home(props: { navigation: any; }) {