Ajout du component SkinAvatar

typescript
Thomas Chazot 2 years ago
parent db8de28d34
commit b4b9742955

@ -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 <View>
<Image source={{uri: skin.source}}/>
<Text>{t}</Text>
return (
<View>
<Image source={{uri: skin.Source}} style={children}/>
</View>
}
*/
)
}

@ -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){

@ -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');

Loading…
Cancel
Save