From f3c24a139acf4be9bb4d96c2650f521491c13913 Mon Sep 17 00:00:00 2001 From: alguilhot Date: Sun, 16 Oct 2022 11:44:57 +0200 Subject: [PATCH] ADD: ajout du skincomponent et 3 cas d'affichage --- bob_party/src/components/Skin.tsx | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bob_party/src/components/Skin.tsx diff --git a/bob_party/src/components/Skin.tsx b/bob_party/src/components/Skin.tsx new file mode 100644 index 0000000..8762a9c --- /dev/null +++ b/bob_party/src/components/Skin.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 styles from "./style/Skin.style" + +export const SkinComponent : +FC<{skin: Skin, state: String}> = +({skin, state}) => +{ + switch (state) { + case 'icon': + return ( + + + + ) + + case 'shop': + return( + Alert.alert("Achat du skin")} style={styles.imageWrapper}> + {skin.getSkinName()} + + 100€ + + ) + case 'profile': + return( + Alert.alert("Achat du skin")} style={styles.imageWrapper}> + {skin.getSkinName()} + + + ) + default: + break; + } +} \ No newline at end of file