try to bind images but it dont work

pull/23/head
Rayhân HASSOU 1 year ago committed by Louison PARANT
parent b1315348ee
commit a004cbdf58

@ -36,14 +36,12 @@ export default function ProfileElement(props : Profile) {
}
let imageSource
if (props.avatar == "plus.png"){
imageSource = require('../assets/images/plus.png')
}
else if (props.avatar == "plus_small.png"){
imageSource = require('../assets/images/plus_small.png')
if(props.avatar == null){
console.log("NUUUULLLLLE" + props.avatar)
}
else{
imageSource = require('../assets/images/logo.png')
imageSource = { uri: props.avatar };
console.log("MAAARCHHEEE" + props.avatar)
}
const styles = StyleSheet.create({

@ -44,7 +44,22 @@ export default function CreateProfile(props) {
<ScrollView>
<LinearGradient colors={[colors.primary, colors.primaryComplement]} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
<View style={{marginTop: "6%"}}/>
<ProfileModification name="" avatar="plus_small.png" diets={die} allergies={all}></ProfileModification>
<View style={styles.background}>
<View style={styles.pseudoBar}>
<Pressable onPress={pickImage}>
<Image source={imageSource} style={styles.avatar}></Image>
</Pressable>
<TextInput style={styles.textInput} value={name} onChangeText={onChangeName} placeholder="Name"></TextInput>
</View>
<View style={styles.filterBar}>
<Text style={styles.filters}>Filters</Text>
<Text style={styles.nbSelected}>"0 diets selected</Text>
</View>
<ListSelect title="Diets" content={die} setSelected={handleSelectedDiets}></ListSelect>
<View style={{marginTop: "6%"}}/>
<ListWithoutSelect title="Allergies" content={all}></ListWithoutSelect>
<View style={{marginTop: "3%"}}/>
</View>
<View style={{marginTop: "3%"}}/>
<ValidateButton title="Create Profile" image="plus.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={handleCreateProfile}></ValidateButton>
<View style={{marginTop: "20%"}}/>

@ -227,7 +227,7 @@ export default function Profiles({navigation, props}) {
avatar={profiles[selectedProfileIndex].avatar}
diets={profiles[selectedProfileIndex].diets}
allergies={profiles[selectedProfileIndex].allergies}
/> */}
/> */}
</View>
<View style={styles.decisionBarVertical}>
<Text style={styles.validationQuestion}>Do you really want to delete this profile?</Text>

Loading…
Cancel
Save