Update Recipe Suggestion Page

pull/20/head
Louison PARANT 1 year ago
parent 3c40ffd567
commit 65d4cf7cd1

@ -6,6 +6,7 @@ import ModifyProfile from './screens/ModifyProfile';
import CreateProfile from './screens/CreateProfile'; import CreateProfile from './screens/CreateProfile';
import FiltersSelection from './screens/FiltersSelection'; import FiltersSelection from './screens/FiltersSelection';
import RecipeSuggestion from './screens/RecipeSuggestion'; import RecipeSuggestion from './screens/RecipeSuggestion';
import RecipeDetail from './screens/RecipeSuggestion';
import {SafeAreaProvider} from 'react-native-safe-area-context'; import {SafeAreaProvider} from 'react-native-safe-area-context';
import {LinearGradient} from 'expo-linear-gradient'; import {LinearGradient} from 'expo-linear-gradient';
@ -15,7 +16,8 @@ export default function App(props) {
//<Profiles/> //<Profiles/>
//<ModifyProfile/> //<ModifyProfile/>
//<CreateProfile/> //<CreateProfile/>
<FiltersSelection/> //<FiltersSelection/>
//<RecipeSuggestion/> <RecipeSuggestion/>
//<RecipeDetail/>
); );
} }

@ -23,25 +23,22 @@ const styles = StyleSheet.create({
width : 150, width : 150,
height: 40, height: 40,
borderRadius: 4, borderRadius: 4,
elevation: 3, backgroundColor: '#F2F0E4',
backgroundColor: 'rgba(0, 0, 0, 0.7)',
}, },
text: { text: {
fontSize: 15, fontSize: 15,
lineHeight: 21,
fontWeight: 'bold', fontWeight: 'bold',
letterSpacing: 0.25, color: '#ACA279',
color: 'white',
}, },
view: { view: {
width : 145, width : 145,
height: 35, height: 35,
borderRadius: 4, borderRadius: 4,
elevation: 3,
borderWidth: 1, borderWidth: 1,
borderColor: 'grey', borderColor: '#ACA279',
alignItems: 'center', // Centre le contenu verticalement alignItems: 'center',
justifyContent: 'center', // Centre le contenu horizontalement justifyContent: 'center',
margin: "1%",
}, },
}); });

@ -1,20 +1,20 @@
import React from 'react'; import React from 'react';
import {StyleSheet,Pressable, Text, View, Image} from 'react-native'; import {StyleSheet,Pressable, Text, View, Image} from 'react-native';
import Separator from '../components/Separator'; import Separator from '../components/Separator';
import plus from '../assets/images/plus.png';
import moins from '../assets/images/minus.png';
interface foodElementTextProps {
interface foodElementImageProps {
title : string title : string
} }
export default function FoodElementText(props : foodElementTextProps) {
export default function FoodElementText(props : any) {
return ( return (
<Pressable style={styles.button}> <Pressable style={styles.button}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.view}> <View style={styles.view}>
<Text style={styles.text}>{props.title}</Text> <Text style={styles.text}>{props.title}</Text>
<Separator/>
</View> </View>
</View> </View>
</Pressable> </Pressable>
@ -25,26 +25,31 @@ const styles = StyleSheet.create({
button: { button: {
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
width: "80%", width : "80%",
borderRadius: 5, borderRadius: 5,
backgroundColor: '#E3DEC9', backgroundColor: '#E3DEC9',
marginHorizontal: "3%",
}, },
text: { text: {
fontSize: 10, fontSize: 15,
lineHeight: 20,
fontWeight: 'bold', fontWeight: 'bold',
padding : "2%", padding : "3%",
color: 'black', color: 'black',
}, },
view: { view: {
alignItems: 'flex-start', alignItems: 'flex-start',
justifyContent: 'center', justifyContent: 'center',
marginRight: "3%",
width: "100%"
}, },
container: { container: {
width: "100%", width: "100%",
height: 50,
borderRadius: 5, borderRadius: 5,
borderWidth: 1, borderWidth: 2,
borderColor: '#3F3C42', borderColor: '#3F3C42',
flexDirection: 'column', flexDirection: 'row',
justifyContent: 'center', justifyContent: 'space-between',
}, },
}); });

@ -0,0 +1,50 @@
import React from 'react';
import {StyleSheet,Pressable, Text, View, Image} from 'react-native';
import Separator from '../components/Separator';
interface foodElementTextProps {
title: string
}
export default function FoodElementTextSimple(props: foodElementTextProps) {
return (
<Pressable style={styles.button}>
<View style={styles.container}>
<View style={styles.view}>
<Text style={styles.text}>{props.title}</Text>
</View>
</View>
</Pressable>
);
}
const styles = StyleSheet.create({
button: {
alignItems: 'center',
justifyContent: 'center',
width: "80%",
borderRadius: 5,
backgroundColor: '#E3DEC9',
},
text: {
fontSize: 10,
fontWeight: 'bold',
padding : "2%",
color: 'black',
},
view: {
alignItems: 'flex-start',
justifyContent: 'center',
},
container: {
width: "100%",
borderRadius: 5,
borderWidth: 1,
borderColor: '#3F3C42',
flexDirection: 'column',
justifyContent: 'center',
},
});

@ -1,27 +1,19 @@
import React from 'react'; import React from 'react';
import { Appbar } from 'react-native-paper'; import { Appbar } from 'react-native-paper';
interface TopBarProps{ interface ParameterTopBarProps{
source : string onEventIngredient: () => void
firstImage : string onEventFilter: () => void
lastImage : string colorIngredients: string
} colorFilters: string
}
export default function ParameterTopBar(props : any) { export default function ParameterTopBar(props : ParameterTopBarProps) {
const goFilter = () =>{
props.onEventFilter('Hello');
}
const goIngredients = () =>{
props.onEventIngredient('Hello');
}
return ( return (
<Appbar.Header style={{backgroundColor: '#F2F0E4', justifyContent: 'center'}} > <Appbar.Header style={{backgroundColor: '#F2F0E4', height: "10%", justifyContent: "center", borderTopLeftRadius: 20, borderTopRightRadius: 20,}}>
<Appbar.Action icon="magnify" onPress={goIngredients} /> <Appbar.Action icon="magnify" onPress={props.onEventIngredient} color={props.colorIngredients}/>
<Appbar.Action icon="dots-vertical" onPress={goFilter} /> <Appbar.Action icon="dots-vertical" onPress={props.onEventFilter} color={props.colorFilters}/>
</Appbar.Header> </Appbar.Header>
); );
} }

@ -37,11 +37,11 @@ export default function ProfileSelection(props: ProfileSelectionProps) {
return ( return (
<View style={styles.background}> <View style={styles.background}>
<Pressable onPress={decreaseCounter}> <Pressable onPress={decreaseCounter}>
<Image source={bracketLeft} style={{width: 40, height: 40, resizeMode: "contain"}}/> <Image source={bracketLeft} style={{width: 40, height: 40, resizeMode: "contain", tintColor: "#3F3C42", }}/>
</Pressable> </Pressable>
<ProfileElement name={props.listProfile[cpt].name} avatar={props.listProfile[cpt].avatar} isActive={props.listProfile[cpt].isActive} disableSelection={props.disableSelection}/> <ProfileElement name={props.listProfile[cpt].name} avatar={props.listProfile[cpt].avatar} isActive={props.listProfile[cpt].isActive} disableSelection={props.disableSelection}/>
<Pressable onPress={increaseCounter}> <Pressable onPress={increaseCounter}>
<Image source={bracketRight} style={{width: 40, height: 40, resizeMode: "contain"}}/> <Image source={bracketRight} style={{width: 40, height: 40, resizeMode: "contain", tintColor: "#3F3C42", }}/>
</Pressable> </Pressable>
</View> </View>
); );

@ -6,63 +6,40 @@ import Union_right from '../assets/images/Union_right.png';
import background from '../assets/images/Background.png'; import background from '../assets/images/Background.png';
interface recipeElementProps { interface recipeElementProps {
number : number number: string
title : string title: string
description : string textList: string[]
imageList : string[] description: string
image : string
} }
export default function RecipeElement(props : any) { export default function RecipeElement(props: recipeElementProps) {
const totalContentCount = props.imageList.length + 11;
const dynamicHeight = totalContentCount * 40;
const scrollViewHeight = 100;
return ( return (
<Pressable style={[styles.button, { height: dynamicHeight }]}> <Pressable style={styles.button}>
<View style={[styles.view, { height: dynamicHeight - 10}]}> <View style={styles.view}>
<Text style={styles.text}>{props.number}</Text> <Text style={styles.text}>{props.number}</Text>
<Text style={styles.title}>{props.title}</Text> <Text style={styles.title}>{props.title}</Text>
<Image source={props.image ? props.image : brochette} style={{ width: 100, height: 100 }}/> <Image source={props.image ? props.image : brochette} style={{width: 100, resizeMode: "contain"}}/>
<View style={styles.horizontalAlignement}> <View style={styles.horizontalAlignment}>
<Image source={Union_left} style={{ width: 70, height: 4, marginRight: 6 }} /> <Image source={Union_left} style={{width: "25%", marginRight: "3%", resizeMode: "contain"}} />
<Text style={styles.text}>Ingredients</Text> <Text style={styles.text}>Ingredients</Text>
<Image source={Union_right} style={{ width: 70, height: 4, marginLeft: 6 }} /> <Image source={Union_right} style={{ width: "25%", marginLeft: "3%", resizeMode: "contain"}} />
</View> </View>
<View style={styles.horizontalAlignment}>
<View style={styles.horizontalAlignement}> {props.textList.length > 0 && props.textList.map((source, index) => (
{props.imageList.length > 0 && props.imageList.map((source, index) => ( <Text key={index} style={styles.smallText}>- {source.title} -</Text>
<Image key={index} source={source} style={{ width: 40, height: 40 }} /> ))}
))}
</View> </View>
{props.imageList.length <= 0 ? (
<View style={styles.horizontalAlignement}>
{props.textList.length > 0 && props.textList.map((source, index) => (
<Text key={index} style={styles.smallText}>{source}</Text>
))}
</View>
) : null}
<View style={styles.scrollViewContainer}> <View style={styles.scrollViewContainer}>
<SafeAreaView> <View style={styles.horizontalAlignment}>
<View style={styles.horizontalAlignement}> <Image source={Union_left} style={{width: "27%", marginRight: "3%", resizeMode: "contain"}}/>
<Image source={Union_left} style={{ width: 70, height: 4, marginRight: 6 }} /> <Text style={styles.text}>Description</Text>
<Text style={styles.text}>Description</Text> <Image source={Union_right} style={{width: "27%", marginLeft: "3%", resizeMode: "contain"}}/>
<Image source={Union_right} style={{ width: 70, height: 4, marginLeft: 6 }} />
</View> </View>
<ScrollView style={{ marginTop: 5, height: scrollViewHeight }}> <ScrollView style={{marginTop: "3%", overflow: "hidden"}}>
<Text style={styles.smallText}>{props.description}</Text> <Text style={styles.smallText}>{props.description}</Text>
</ScrollView> </ScrollView>
</SafeAreaView>
</View> </View>
<Image source={background} style={{width: "80%", resizeMode: "contain"}}></Image>
<Image source={background} style={{width: 210, height: 20, marginTop: dynamicHeight - 50, position: 'absolute'}}></Image>
</View> </View>
</Pressable> </Pressable>
); );
@ -73,54 +50,47 @@ const styles = StyleSheet.create({
button: { button: {
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
width : 300, width: 300,
height: "90%",
borderRadius: 40, borderRadius: 40,
elevation: 3,
backgroundColor: '#E3DEC9', backgroundColor: '#E3DEC9',
}, },
text: { text: {
fontSize: 14, fontSize: 15,
lineHeight: 21,
fontWeight: 'bold', fontWeight: 'bold',
letterSpacing: 0.25,
color: '#756C28', color: '#756C28',
marginTop: 10, marginTop: "4%",
}, },
smallText: { smallText: {
fontSize: 12, fontSize: 12,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: '#71662A', color: '#71662A',
textAlign: "center", textAlign: "center",
margin : 5 margin : "2%"
}, },
title:{ title:{
fontSize: 18, fontSize: 18,
lineHeight: 21,
fontWeight: 'bold', fontWeight: 'bold',
letterSpacing: 0.25,
color: '#524B1A', color: '#524B1A',
}, },
view: { view: {
width : 290, width : "95%",
height: "96.5%",
borderRadius: 40, borderRadius: 40,
elevation: 3,
borderWidth: 2, borderWidth: 2,
borderColor: 'grey', padding: "5%",
alignItems: 'center', // Centre le contenu verticalement borderColor: '#3F3C42',
display: "flex", alignItems: 'center',
flexWrap: "wrap", justifyContent: "center",
}, },
horizontalAlignement: { horizontalAlignment: {
display: "flex", display: "flex",
flexDirection : 'row', flexDirection : 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
marginTop : 5, marginTop : "2%",
flexWrap: 'wrap', flexWrap: 'wrap',
}, },
scrollViewContainer: { scrollViewContainer: {
flex: 1, // Assurez-vous que le reste du contenu occupe l'espace restant flex: 1,
}, },
}); });

@ -1,58 +1,51 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, StyleSheet, Pressable, Image, Text } from 'react-native'; import {View, StyleSheet, Pressable, Image, Text} from 'react-native';
import bracketLeft from '../assets/images/angle_bracket_left.png'; import bracketLeft from '../assets/images/angle_bracket_left.png';
import bracketRight from '../assets/images/angle_bracket_right.png'; import bracketRight from '../assets/images/angle_bracket_right.png';
import parameter from '../assets/images/parameter.png'; import parameter from '../assets/images/parameter.png';
import FoodElementText from './FoodElementText'; import FoodElementText from './FoodElementText';
interface SelectedIngredientProps { interface SelectedIngredientProps {
listeIngredient: string[]; ingredientList: string[]
listeImage: string[]; onEvent: () => void
onEvent: (value: string) => void;
} }
export default function SelectedIngredient(props: SelectedIngredientProps) { export default function SelectedIngredient(props: SelectedIngredientProps) {
const [cpt, setCpt] = useState(0); const [cpt, setCpt] = useState(0);
const decreaseCounter = () => { const decreaseCounter = () => {
if (cpt > 0) { if(cpt > 0){
setCpt(cpt - 1); setCpt(cpt - 1);
} else { }
setCpt(props.listeIngredient.length - 1); else{
setCpt(props.ingredientList.length - 1);
} }
}; };
const increaseCounter = () => { const increaseCounter = () => {
if (cpt < props.listeIngredient.length - 1) { if(cpt < props.ingredientList.length - 1){
setCpt(cpt + 1); setCpt(cpt + 1);
} else { }
else{
setCpt(0); setCpt(0);
} }
}; };
const handlePress = () => {
// Supposons que vous voulez envoyer la valeur 'Hello' au parent
props.onEvent('Hello');
};
return ( return (
<View style={styles.view}> <View style={styles.view}>
<View id="Top" style={styles.horizontalAlignement}> <View style={styles.horizontalAlignment}>
<Text style={styles.text}>Selected ingredients</Text> <Text style={styles.text}>Selected ingredients</Text>
<Pressable onPress={handlePress}> <Pressable onPress={props.onEvent}>
<Image source={parameter} style={{ width: 15, height: 15 }} /> <Image source={parameter} style={{tintColor: "#3F3C42", resizeMode: "contain", flex: 1, marginRight: "8%"}}/>
</Pressable> </Pressable>
</View> </View>
<View id="IngredientList" style={styles.horizontalAlignement}> <View style={styles.horizontalAlignment}>
<Pressable onPress={decreaseCounter} id="GoLeft" style={{}}> <Pressable onPress={decreaseCounter}>
<Image source={bracketLeft} style={{ width: 40, height: 40 }} /> <Image source={bracketLeft} style={{width: 40, height: 40, tintColor: "#3F3C42", resizeMode: "contain"}}/>
</Pressable> </Pressable>
<FoodElementText title={props.ingredientList[cpt].title}/>
<FoodElementText title={props.listeIngredient[cpt]} /> <Pressable onPress={increaseCounter}>
<Image source={bracketRight} style={{width: 40, height: 40, tintColor: "#3F3C42", resizeMode: "contain"}}/>
<Pressable onPress={increaseCounter} id="GoRight" style={{}}>
<Image source={bracketRight} style={{ width: 40, height: 40 }} />
</Pressable> </Pressable>
</View> </View>
</View> </View>
@ -61,30 +54,26 @@ export default function SelectedIngredient(props: SelectedIngredientProps) {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
view: { view: {
width: 350, width: "90%",
height: 110, paddingBottom: "5%",
borderRadius: 15, borderRadius: 15,
elevation: 3, borderColor: '#3F3C42',
borderWidth: 1,
borderColor: 'black',
display: 'flex',
flexWrap: 'wrap',
backgroundColor: '#E3DEC9', backgroundColor: '#E3DEC9',
alignItems: "center",
justifyContent: "center",
}, },
horizontalAlignement: { horizontalAlignment: {
display: 'flex', width: "90%",
height: 30,
width: 350,
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-around', justifyContent: 'space-evenly',
alignItems: 'center', alignItems: 'center',
marginTop: 10, marginTop: "3%",
}, },
text: { text: {
fontSize: 14, fontSize: 15,
lineHeight: 21,
fontWeight: 'bold', fontWeight: 'bold',
letterSpacing: 0.25, color: '#3F3C42',
color: 'black', flex: 1,
marginLeft: "8%",
}, },
}); });

@ -13,12 +13,11 @@ export default function TopBar(props) {
return ( return (
<Appbar.Header style={{backgroundColor: '#F2F0E4'}} > <Appbar.Header style={{backgroundColor: '#F2F0E4'}} >
<Appbar.BackAction onPress={_goBack} /> <Appbar.BackAction onPress={_goBack} color={"#3F3C42"}/>
<Appbar.Content title={props.title} /> <Appbar.Content title={props.title} color={"#3F3C42"}/>
{props.isVisible &&( {props.isVisible &&(
<><Appbar.Action icon="magnify" onPress={_handleSearch} /> <><Appbar.Action icon="magnify" onPress={_handleSearch} color={"#3F3C42"}/>
<Appbar.Action icon="dots-vertical" onPress={_handleMore} /> <Appbar.Action icon="dots-vertical" onPress={_handleMore} color={"#3F3C42"}/>
</> </>
)} )}
</Appbar.Header> </Appbar.Header>

@ -94,7 +94,7 @@ const styles = StyleSheet.create({
height: "100%", height: "100%",
width: "100%", width: "100%",
flex: 1, flex: 1,
padding: 10, padding: "2%",
paddingTop: 0, paddingTop: 0,
}, },
separator: { separator: {

@ -1,162 +1,240 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, StyleSheet, Text, Image, Pressable} from 'react-native'; import {View, StyleSheet, Text, Image, Pressable, useWindowDimensions, ScrollView} from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context'; import {SafeAreaProvider } from 'react-native-safe-area-context';
import { Modal, Portal, PaperProvider} from 'react-native-paper'; import {Modal, Portal, PaperProvider} from 'react-native-paper';
import {LinearGradient} from 'expo-linear-gradient';
import TopBar from '../components/TopBar'; import TopBar from '../components/TopBar';
import RecipeElement from '../components/RecipeElement'; import RecipeElement from '../components/RecipeElement';
import SelectedIngredient from '../components/SelectedIngredient'; import SelectedIngredient from '../components/SelectedIngredient';
import FoodElementTextSimple from '../components/FoodElementTextSimple';
import FoodElementText from '../components/FoodElementText'; import FoodElementText from '../components/FoodElementText';
import brochette from '../assets/images/brochette.png'; import brochette from '../assets/images/brochette.png';
import ParameterTopBar from '../components/ParameterTopBar'; import ParameterTopBar from '../components/ParameterTopBar';
import ListSelect from '../components/ListSelect';
import ListWithoutSelect from '../components/ListWithoutSelect';
import ValidateButton from '../components/ValidateButton';
import bracketLeft from '../assets/images/angle_bracket_left.png'; import bracketLeft from '../assets/images/angle_bracket_left.png';
import bracketRight from '../assets/images/angle_bracket_right.png'; import bracketRight from '../assets/images/angle_bracket_right.png';
import CustomButton from '../components/CustomButton'; import CustomButton from '../components/CustomButton';
import plus from '../assets/images/plus_small.png';
import minus from '../assets/images/minus.png';
export default function RecipeSuggestion(props) { export default function RecipeSuggestion(props) {
const [visible, setVisible] = React.useState(true);
const imageList = [];
const [visible, setVisible] = React.useState(false);
const [visibleFilters, setVisibleFilters] = React.useState(false); const [visibleFilters, setVisibleFilters] = React.useState(false);
const [visibleIngredients, setVisibleIngredients] = React.useState(true); const [visibleIngredients, setVisibleIngredients] = React.useState(true);
const [minCpt, setMinCpt] = useState(0); const [minCpt, setMinCpt] = useState(0);
const [maxCpt, setMaxCpt] = useState(4); const [maxCpt, setMaxCpt] = useState(4);
const listeIngredient = props.list; const ingredientList = [{title: "Steak"}, {title: "Sheep Ribs"}, {title: "Rabbit Thigh"}, {title: "Ham"}, {title: "Cream (Liquid)"}, {title: "Pepper Bell"}]
const limitedList = listeIngredient.slice(minCpt, maxCpt); const ingredientListV2 = [{title: "Smoked Salmon"}, {title: "Tomato"}, {title: "Carrot"}]
const showModal = () => setVisible(true); const limitedList = ingredientList.slice(minCpt, maxCpt);
const hideModal = () => setVisible(false); const [colorIngredients, setColorIngredients] = useState("#59BDCD");
const [colorFilters, setColorFilters] = useState("#3F3C42");
const die = [{value: "Gluten free"}, {value: "Porkless"}, {value: "Gluten free"}, {value: "Porkless"}]
const all = []
const containerStyle = { const containerStyle = {
backgroundColor: 'white', //minHeight: useWindowDimensions().height/2,
height: 450, //width: useWindowDimensions().width,
width: 380, height: "75%",
width: "100%",
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
}; };
const handleChildEvent = (value) => { const handleChildEvent = () => {
setVisible(!visible) setVisible(!visible)
}; }
const handleChildEventGoFilters = () => {
const handleChildEventGoFilters = (value) => {
setVisibleIngredients(false); setVisibleIngredients(false);
setVisibleFilters(true); setVisibleFilters(true);
setColorFilters("#59BDCD")
setColorIngredients("#3F3C42")
} }
const handleChildEventGoIngredients = () => {
const handleChildEventGoIngredients = (value) => {
setVisibleFilters(false); setVisibleFilters(false);
setVisibleIngredients(true); setVisibleIngredients(true);
console.log("jai change pour iingredient"); setColorFilters("#3F3C42")
setColorIngredients("#59BDCD")
} }
const decreaseCounter = () => { const decreaseCounter = () => {
if (minCpt > 0) { if (minCpt > 0) {
setMinCpt(minCpt - 4); setMinCpt(minCpt - 4);
setMaxCpt(maxCpt - 4) setMaxCpt(maxCpt - 4)
} }
}; else{
setMaxCpt(ingredientList.length+ingredientList.length%4)
var cpt=ingredientList.length-(ingredientList.length%4)
setMinCpt(cpt)
}
}
const increaseCounter = () => { const increaseCounter = () => {
if (maxCpt < listeIngredient.length) { if (maxCpt < ingredientList.length) {
setMinCpt(minCpt + 4); setMinCpt(minCpt + 4);
setMaxCpt(maxCpt + 4) setMaxCpt(maxCpt + 4)
} }
}; else{
setMinCpt(0)
setMaxCpt(4)
}
}
const imageElements = limitedList.map((source, index) => ( const imageElements = limitedList.map((source, index) => (
<View style={[styles.horizontalAlignement, { marginBottom: 10 }]}> <View style={[styles.horizontalAlignment, {marginVertical: "3%"}]}>
<FoodElementText key={index} title={source} /> <FoodElementTextSimple title={source.title}/>
<Image source={brochette} style={{ width: 20, height: 20 }} /> <Image source={plus} style={{width: 20, resizeMode: "contain"}}/>
<Image source={brochette} style={{ width: 20, height: 20 }} /> <Image source={minus} style={{width: 20, resizeMode: "contain"}}/>
</View> </View>
)); ));
return ( return (
<SafeAreaProvider> <SafeAreaProvider style={{flex: 1}}>
<PaperProvider>
<TopBar title="Recipes" isVisible="true"/> <TopBar title="Recipes" isVisible="true"/>
<View style={styles.page}> <ScrollView>
<SelectedIngredient <LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
listeIngredient={props.list} <View style={{marginTop: "6%"}}/>
listeImage={imageList} <SelectedIngredient
onEvent={handleChildEvent} ingredientList={ingredientList}
/> onEvent={handleChildEvent}/>
<View style={{ marginTop: 100 }}> <ScrollView style={{marginTop: "6%"}} horizontal={true}>
<RecipeElement <View style={{marginHorizontal: 10}}/>
number="13" <RecipeElement
title="Pizza with Pineapples" number="63"
imageList={imageList} title="Meat Stick"
textList={props.list} textList={ingredientList}
description="delicious plate that will please you" description="Delicious stick with 4 meats. Accessible for beginners. 20 min or less to cook."/>
style={styles.element} <View style={{marginHorizontal: 10}}/>
/> <RecipeElement
</View> number="03"
</View> title="Vichyssoise"
<View style={styles.modal}> textList={ingredientListV2}
<PaperProvider> description="Cold soup of vegetables. Difficult recipe. Not advised to beginners. 1h or more."/>
<Portal> <View style={{marginHorizontal: 10}}/>
<Modal visible={visible} onDismiss={hideModal} contentContainerStyle={containerStyle}> </ScrollView>
<ParameterTopBar onEventFilter={handleChildEventGoFilters} onEventIngredient={handleChildEventGoIngredients}></ParameterTopBar> <View style={{marginBottom: "20%"}}/>
</LinearGradient>
{visibleIngredients && ( </ScrollView>
<View style={[styles.page, { justifyContent: 'space-between' }]}> <Portal>
{imageElements} <Modal visible={visible} onDismiss={handleChildEvent} contentContainerStyle={containerStyle} style={{marginTop: 0, justifyContent: "flex-end"}}>
<View id="IngredientList" style={[styles.horizontalAlignement, {marginTop: 10}]}> <ParameterTopBar onEventFilter={handleChildEventGoFilters} onEventIngredient={handleChildEventGoIngredients} colorFilters={colorFilters} colorIngredients={colorIngredients}/>
<Pressable onPress={decreaseCounter} id="GoLeft" > {visibleIngredients &&(
<Image source={bracketLeft} style={{ width: 20, height: 20 }} /> <LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {paddingHorizontal: "3%"}]}>
</Pressable> {imageElements}
<View style={[styles.horizontalAlignment, {marginTop: "6%"}]}>
<Pressable onPress={increaseCounter} id="GoRight"> <Pressable onPress={decreaseCounter}>
<Image source={bracketRight} style={{ width: 20, height: 20 }} /> <Image source={bracketLeft} style={{width: 30, height: "100%", resizeMode: "contain", tintColor: "#3F3C42"}}/>
</Pressable> </Pressable>
</View> <CustomButton title="Save"></CustomButton>
<Pressable onPress={increaseCounter}>
<View> <Image source={bracketRight} style={{width: 30, height: "100%", resizeMode: "contain", tintColor: "#3F3C42"}}/>
<CustomButton title="Save"></CustomButton> </Pressable>
</View>
</View> </View>
)} </LinearGradient>
{visibleFilters &&( )}
<View style={[styles.page, { justifyContent: 'space-between'}]}> {visibleFilters &&(
<Text>HEHEHEHEHEHEHE</Text> <ScrollView>
<View> <LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {paddingHorizontal: "3%"}]}>
<CustomButton title="Save"></CustomButton> <View style={{marginTop: "10%"}}/>
</View> <View style={styles.background}>
</View> <View style={styles.filterBar}>
)} <Text style={styles.filters}>Additional Filters</Text>
</Modal> <Text style={styles.nbSelected}>{die.length} selected</Text>
</Portal> </View>
</PaperProvider> <ListWithoutSelect title="Diets" content={die}></ListWithoutSelect>
</View> <View style={{marginTop: "3%"}}/>
<ListWithoutSelect title="Allergies" content={all}></ListWithoutSelect>
<View style={{marginTop: "3%"}}/>
<ValidateButton title="Add Allergy" image="plus.png" colour="#59BDCD" backColour="#E3DEC9"></ValidateButton>
</View>
<View style={{marginTop: "6%"}}/>
<View>
<CustomButton title="Save"></CustomButton>
</View>
<View style={{marginTop: "43%"}}/>
</LinearGradient>
</ScrollView>
)}
</Modal>
</Portal>
</PaperProvider>
</SafeAreaProvider> </SafeAreaProvider>
); );
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
page: { linearGradient: {
flex: 1, width: "100%",
backgroundColor: '#59BDCD', flex: 1,
alignItems: 'center', //padding: "2%",
display: 'flex', paddingTop: 0,
flexWrap: 'wrap', alignItems: "center",
padding: 20, justifyContent: "center"
},
background: {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 20,
backgroundColor: '#F2F0E4',
padding: "3%",
marginHorizontal: "3%",
},
filterBar: {
flexDirection: "row",
width: "85%",
paddingTop: "3%",
paddingBottom: "2%",
alignItems: "flex-end",
justifyContent: "center",
}, },
element: { filters: {
marginTop: 20, fontSize: 20,
color: '#ACA279',
flex: 1,
}, },
backdrop: { nbSelected: {
backgroundColor: 'rgba(0, 0, 0, 0.5)', fontSize: 11,
color: "#3F3C42",
textAlign: "right",
}, },
page: {
flex: 1,
backgroundColor: '#59BDCD',
alignItems: 'center',
paddingHorizontal: "3%",
},
modal :{ modal :{
position: 'absolute', position: 'absolute',
top: '50%', // Centre verticalement top: '50%',
left: '50%', // Centre horizontalement height: "50%",
transform: [{ translateX: -185 }, { translateY: -90 }], // Ajustez en fonction de la moitié de la hauteur et de la largeur width: "100%",
borderWidth: 1,
borderColor: "red",
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
}, },
horizontalAlignement: { horizontalAlignment: {
display: 'flex', display: 'flex',
height: 30, height: "10%",
width: 350, width: "100%",
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-around', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
marginTop: 10, },
}
recipes: {
flexDirection: "row",
overflow: "scroll",
alignItems: "flex-start",
justifyContent: "center",
},
}); });
Loading…
Cancel
Save