From b4b97429559e7052c17664df84a9135b57459812 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Wed, 12 Oct 2022 10:56:35 +0200 Subject: [PATCH 1/3] Ajout du component SkinAvatar --- bob_party/components/skinAvatar.tsx | 17 +++++++++-------- bob_party/core/skin.ts | 4 ++-- bob_party/src/screens/Home.tsx | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bob_party/components/skinAvatar.tsx b/bob_party/components/skinAvatar.tsx index 65bc43c..98d353c 100644 --- a/bob_party/components/skinAvatar.tsx +++ b/bob_party/components/skinAvatar.tsx @@ -1,13 +1,14 @@ import { FC, ReactNode } from "react" -import { Button, Image, Text, View } from "react-native" +import { Button, Image, ImageStyle, Text, View } from "react-native" import { Skin } from "../core/Skin" +import React from "react" -/* -export const SkinComponent : FC<{skin: Skin, children: ReactNode}> = ({skin, children}) => { +export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => { - return - - {t} + + return ( + + -} -*/ \ No newline at end of file + ) +} \ No newline at end of file diff --git a/bob_party/core/skin.ts b/bob_party/core/skin.ts index 3d3f320..4f13313 100644 --- a/bob_party/core/skin.ts +++ b/bob_party/core/skin.ts @@ -1,10 +1,10 @@ export class Skin{ private Name: string; - private Source: string; + Source: string; constructor(name: string, source:string){ this.Name=name; - this.Source=source; + this.Source=require(source); } setSkinName(name: string){ diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index 21f1507..fabd8a9 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -1,6 +1,7 @@ import { StatusBar } from 'expo-status-bar' import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native' import React from 'react'; +import { SkinComponent } from '../../components/skinAvatar'; const avatar = require('../../assets/Icons/BobClassic.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); From 9060645aa36c3d75cc6c900ad7c449adc42fc427 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Wed, 12 Oct 2022 11:23:16 +0200 Subject: [PATCH 2/3] ADD: Ajout du composant skinAvatar --- bob_party/components/skinAvatar.tsx | 3 ++- bob_party/core/skin.ts | 2 +- bob_party/src/screens/Home.tsx | 11 ++++++----- bob_party/src/screens/Store.tsx | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bob_party/components/skinAvatar.tsx b/bob_party/components/skinAvatar.tsx index 98d353c..b708e2f 100644 --- a/bob_party/components/skinAvatar.tsx +++ b/bob_party/components/skinAvatar.tsx @@ -3,12 +3,13 @@ import { Button, Image, ImageStyle, Text, View } from "react-native" import { Skin } from "../core/Skin" import React from "react" -export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => { +export const SkinComponent : FC<{skin: Skin, children: ImageStyle, childrenTest: ReactNode}> = ({skin, children, childrenTest}) => { return ( + {childrenTest} ) } \ No newline at end of file diff --git a/bob_party/core/skin.ts b/bob_party/core/skin.ts index 4f13313..a8c61d1 100644 --- a/bob_party/core/skin.ts +++ b/bob_party/core/skin.ts @@ -4,7 +4,7 @@ export class Skin{ constructor(name: string, source:string){ this.Name=name; - this.Source=require(source); + this.Source=source; } setSkinName(name: string){ diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index fabd8a9..ea853b0 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -2,10 +2,14 @@ import { StatusBar } from 'expo-status-bar' import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native' import React from 'react'; import { SkinComponent } from '../../components/skinAvatar'; +import { User } from '../../core/user'; +import { Skin } from '../../core/skin'; + const avatar = require('../../assets/Icons/BobClassic.png'); +const skinTest= new Skin("Bob", '../../assets/Icons/BobClassic.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); -const gamepad = require('../../assets/Icons/Selected/SGamepad.png'); +const gamepad = require('../../assets/Icons/Selected/Gamepad.png'); const message = require('../../assets/Icons/UnSelected/Chat.png'); const store = require('../../assets/Icons/UnSelected/Store.png'); @@ -15,10 +19,7 @@ function Home(props: { navigation: any; }) { Alert.alert('Profil Joueur')}> - + Bite} /> BOB PARTY navigation.navigate('Settings')}> diff --git a/bob_party/src/screens/Store.tsx b/bob_party/src/screens/Store.tsx index ed1e514..8e2a129 100644 --- a/bob_party/src/screens/Store.tsx +++ b/bob_party/src/screens/Store.tsx @@ -6,7 +6,7 @@ const avatar = require('../../assets/Icons/BobClassic.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png'); const message = require('../../assets/Icons/UnSelected/Chat.png'); -const store = require('../../assets/Icons/Selected/SStore.png'); +const store = require('../../assets/Icons/Selected/Store.png'); function Store(props: { navigation: any; }) { const { navigation } = props From cdfb3127b65d504e87115c11e8f1d88df67e2c9e Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Wed, 12 Oct 2022 11:24:36 +0200 Subject: [PATCH 3/3] =?UTF-8?q?MOVE:=20d=C3=A9placement=20de=20core=20et?= =?UTF-8?q?=20de=20composent=20dans=20src?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bob_party/{ => src}/components/skinAvatar.tsx | 0 bob_party/{ => src}/core/skin.ts | 0 bob_party/{ => src}/core/user.ts | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename bob_party/{ => src}/components/skinAvatar.tsx (100%) rename bob_party/{ => src}/core/skin.ts (100%) rename bob_party/{ => src}/core/user.ts (100%) diff --git a/bob_party/components/skinAvatar.tsx b/bob_party/src/components/skinAvatar.tsx similarity index 100% rename from bob_party/components/skinAvatar.tsx rename to bob_party/src/components/skinAvatar.tsx diff --git a/bob_party/core/skin.ts b/bob_party/src/core/skin.ts similarity index 100% rename from bob_party/core/skin.ts rename to bob_party/src/core/skin.ts diff --git a/bob_party/core/user.ts b/bob_party/src/core/user.ts similarity index 100% rename from bob_party/core/user.ts rename to bob_party/src/core/user.ts