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

pull/20/head
Louison PARANT 2 years ago
parent c5ec8302b2
commit ebcbead910

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

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

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

@ -19,7 +19,7 @@ export default function CookingStackScreen() {
options={{ options={{
headerStyle: {backgroundColor: theme === 'light' ? '#F2F0E4' : '#3F3C42'}, headerStyle: {backgroundColor: theme === 'light' ? '#F2F0E4' : '#3F3C42'},
headerTitle: () => ( 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'); const _handleHeaderAdd = () => navigation.navigate('ProfileCreation');
return ( return (

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

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

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

Loading…
Cancel
Save