Kdo Rayhan pour merge
continuous-integration/drone/push Build is passing Details

pull/20/head
Louison PARANT 1 year ago
parent c5ec8302b2
commit ebcbead910

@ -9,6 +9,7 @@ type ProfileProps = {
avatar: string
diets: string[]
allergies: string[]
onModification: () => void
onDeleteProfile: () => void
}
@ -78,10 +79,10 @@ export default function ProfileDetails(props) {
},
modify: {
height: "100%",
width: "100%",
tintColor: colors.cardElementBorder,
resizeMode: 'contain',
flex: 0.1,
marginLeft: "3%",
flex: 1,
},
delete: {
height: "100%",
@ -128,7 +129,9 @@ export default function ProfileDetails(props) {
<View style={styles.pseudoBar}>
<Image source={imageSource} style={styles.avatar}></Image>
<Text style={styles.text}>{props.name}</Text>
<Image source={require("../assets/images/modify.png")} style={styles.modify}></Image>
<Pressable onPress={props.onModification} style={{flex: 0.1, marginRight: "1%",}}>
<Image source={require("../assets/images/modify.png")} style={styles.modify}></Image>
</Pressable>
<Pressable onPress={props.onDeleteProfile} style={{flex: 0.1, marginLeft: "1%",}}>
<Image source={require("../assets/images/delete.png")} style={styles.delete}></Image>
</Pressable>

@ -33,7 +33,6 @@ export default function ProfileElement(props : Profile) {
else{
setSeparator("none")
}
console.log(waiting, separator, props.name)
}
let imageSource

@ -60,7 +60,7 @@ export default function ProfileModification(props: ProfileProps) {
},
textInput: {
fontSize: 15,
color: colors.cardTitle,
color: colors.cardDetail,
borderRadius: 10,
borderWidth: 2,
borderStyle: 'dashed',
@ -92,11 +92,6 @@ export default function ProfileModification(props: ProfileProps) {
color: colors.cardElementBorder,
flex: 1,
},
nbSelected: {
fontSize: 11,
color: colors.cardDetail,
textAlign: "right",
}
});
return (
@ -108,7 +103,6 @@ export default function ProfileModification(props: ProfileProps) {
</View>
<View style={styles.filterBar}>
<Text style={styles.filters}>Filters</Text>
<Text style={styles.nbSelected}>0 diets selected</Text>
</View>
<ListSelect title="Diets" content={props.diets}></ListSelect>
<View style={{marginTop: "6%"}}/>

@ -19,7 +19,7 @@ export default function CookingStackScreen() {
options={{
headerStyle: {backgroundColor: theme === 'light' ? '#F2F0E4' : '#3F3C42'},
headerTitle: () => (
<HeaderTitle title='Profile Modification'/>
<HeaderTitle title='Ingredient Selection'/>
)
}}
/>

@ -34,7 +34,10 @@ export default function ProfilesStackScreen({ navigation }) {
}
})
const _handleSearch = () => console.log('Searching');
const _handleSearch = () => {
console.log('Searching');
navigation.navigate('ProfileModification')
}
const _handleHeaderAdd = () => navigation.navigate('ProfileCreation');
return (

@ -70,7 +70,7 @@ export default function HomePage({ navigation, props }) {
},
filters: {
fontSize: 20,
color: colors.cardTitle,
color: colors.cardElementBorder,
flex: 1,
},
nbSelected: {
@ -121,6 +121,16 @@ export default function HomePage({ navigation, props }) {
}
});
const nbActiveProfiles = () => {
let cpt = 0
profiles.forEach((val) => {
if(val.isActive == "flex"){
cpt += 1
}
})
return cpt
}
return (
<SafeAreaProvider style={{flex: 1}}>
<ScrollView>
@ -130,7 +140,7 @@ export default function HomePage({ navigation, props }) {
<View style={{flexDirection: "column", alignItems: "flex-start", justifyContent: "center", width: "100%"}}>
<View style={{flexDirection: "row"}}>
<Text style={styles.text}>Welcome </Text>
<Text style={styles.name}>Rayhân</Text>
<Text style={styles.name}>Louison</Text>
<Text style={styles.text}>,</Text>
</View>
<Text style={styles.text}>Glad to see you again!</Text>
@ -140,7 +150,7 @@ export default function HomePage({ navigation, props }) {
<View style={styles.profilesSelection}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Profiles</Text>
<Text style={styles.nbSelected}>2 selected</Text>
<Text style={styles.nbSelected}>{nbActiveProfiles()} selected</Text>
</View>
<View style={{marginTop: "3%"}}/>
<ProfileSelection listProfile={profiles} disableSelection={true}/>

@ -15,12 +15,12 @@ export default function ModifyProfile(props) {
return (
<SafeAreaProvider style={{flex: 1}}>
<ScrollView style={{minHeight: useWindowDimensions().height}}>
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
<LinearGradient colors={[colors.primary, colors.primaryComplement]} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
<View style={{marginTop: "6%"}}/>
<ProfileModification name="Johnny Silverhand" avatar="plus_small.png" diets={die} allergies={all}></ProfileModification>
<View style={{marginTop: "3%"}}/>
<ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.buttonBackground} todo={() => (console.log("Profile Modified"))}></ValidateButton>
<View style={{marginBottom: "20%"}}/>
<ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={() => (console.log("Profile Modified"))}></ValidateButton>
<View style={{marginTop: "20%"}}/>
</LinearGradient>
</ScrollView>
</SafeAreaProvider>
@ -28,14 +28,6 @@ export default function ModifyProfile(props) {
}
const styles = StyleSheet.create({
container: {
height: "100%",
width: "100%",
flex: 1,
backgroundColor: '#3F3C42',
alignItems: 'center',
justifyContent: 'center',
},
linearGradient: {
height: "100%",
width: "100%",

@ -168,10 +168,11 @@ export default function Profiles({navigation, props}) {
avatar={profile.avatar}
diets={profile.diets}
allergies={profile.allergies}
onModification={() => navigation.navigate('ProfileModification')}
onDeleteProfile={raisePopUp}/>
{index < profiles.length - 1 && <View style={styles.separator} />}
{index < profiles.length - 1 && <View style={styles.separator}/>}
</View>
));
));
return (
<SafeAreaProvider style={{flex: 1}}>

Loading…
Cancel
Save