diff --git a/LeftOvers/App.js b/LeftOvers/App.js index 7c5d287..ed37109 100644 --- a/LeftOvers/App.js +++ b/LeftOvers/App.js @@ -1,29 +1,25 @@ import React from 'react'; import { StyleSheet, View } from 'react-native'; -import RecipeElement from './components/RecipeElement'; +import SelectedIngredient from './components/SelectedIngredient'; import RecipeElementReduce from './components/RecipeElementReduce'; +import RecipeElement from './components/RecipeElement'; -const generateImageList = () => { - const imageList = []; - const meat = '../assets/images/meat.png'; - for (let i = 0; i < 5; i++) { - imageList.push(meat); - } - return imageList; +const generateList = () => { + const list = []; + list.push('Apple'); + list.push('Pineapple'); + list.push('Tomato'); + list.push('Meat') + return list; }; export default function App() { const imageList = []; + const list = generateList(); return ( - - - - + ); } diff --git a/LeftOvers/assets/images/angle_bracket_left.png b/LeftOvers/assets/images/angle_bracket_left.png new file mode 100644 index 0000000..7af1534 Binary files /dev/null and b/LeftOvers/assets/images/angle_bracket_left.png differ diff --git a/LeftOvers/assets/images/angle_bracket_right.png b/LeftOvers/assets/images/angle_bracket_right.png new file mode 100644 index 0000000..58fb0b9 Binary files /dev/null and b/LeftOvers/assets/images/angle_bracket_right.png differ diff --git a/LeftOvers/assets/images/parameter.png b/LeftOvers/assets/images/parameter.png new file mode 100644 index 0000000..08425b4 Binary files /dev/null and b/LeftOvers/assets/images/parameter.png differ diff --git a/LeftOvers/components/FoodElementText.tsx b/LeftOvers/components/FoodElementText.tsx index 2e6062c..1e3b028 100644 --- a/LeftOvers/components/FoodElementText.tsx +++ b/LeftOvers/components/FoodElementText.tsx @@ -19,9 +19,7 @@ export default function FoodElementText(props : any) { {props.title} - - ); @@ -31,7 +29,7 @@ const styles = StyleSheet.create({ button: { alignItems: 'center', justifyContent: 'center', - width : 350, + width : 270, height: 60, borderRadius: 5, elevation: 3, @@ -52,7 +50,7 @@ const styles = StyleSheet.create({ marginRight: 5 // Centre le contenu horizontalement }, container: { - width : 340, + width :260, height: 50, borderRadius: 5, elevation: 3, @@ -62,5 +60,3 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', }, }); - - diff --git a/LeftOvers/components/RecipeElementReduce.tsx b/LeftOvers/components/RecipeElementReduce.tsx index b4d7920..88f8a59 100644 --- a/LeftOvers/components/RecipeElementReduce.tsx +++ b/LeftOvers/components/RecipeElementReduce.tsx @@ -1,8 +1,6 @@ import React from 'react'; import {StyleSheet,Pressable, Text, View, Image} from 'react-native'; import brochette from '../assets/images/brochette.png'; -import Union_left from '../assets/images/Union_left.png'; -import Union_right from '../assets/images/Union_right.png'; import background from '../assets/images/Background.png'; import normalize from './Normalize'; @@ -14,6 +12,8 @@ interface recipeElementReduceProps { duree : string } + + export default function RecipeElementReduce(props : any) { return ( diff --git a/LeftOvers/components/SelectedIngredient.tsx b/LeftOvers/components/SelectedIngredient.tsx new file mode 100644 index 0000000..e739d41 --- /dev/null +++ b/LeftOvers/components/SelectedIngredient.tsx @@ -0,0 +1,90 @@ +import React, { useState } from 'react'; +import {StyleSheet,Pressable, Text, View, Image} from 'react-native'; +import bracketLeft from '../assets/images/angle_bracket_left.png'; +import bracketRight from '../assets/images/angle_bracket_right.png'; +import parameter from '../assets/images/parameter.png'; +import FoodElementText from './FoodElementText'; + +interface selectedIngredientProps { + listeIngredient : string[] + listeImage : string[] + +} + +export default function SelectedIngredient(props : any) { + + const [cpt, setCpt] = useState(0); + + const decreaseCounter = () => { + if (cpt > 0) { + setCpt(cpt - 1); + } + else{ + setCpt( props.listeIngredient.length - 1); + } + }; + + const increaseCounter = () => { + if (cpt < props.listeIngredient.length - 1) { + setCpt(cpt + 1); + }else{ + setCpt(0); + } + }; + + return ( + + + Selected ingredients + + + + + + + + + + + + + + + + + + + ); +} + +const styles = StyleSheet.create({ + view: { + width : 350, + height: 120, + borderRadius: 10, + elevation: 3, + borderWidth: 2, + borderColor: 'black', + display: "flex", + flexWrap: "wrap", + backgroundColor: '#E3DEC9', + }, + horizontalAlignement: { + display: "flex", + height : 40, + width: 350, + flexDirection : 'row', + justifyContent : 'space-around', + alignItems: 'center', + marginTop: 10, + }, + text: { + fontSize: 14, + lineHeight: 21, + fontWeight: 'bold', + letterSpacing: 0.25, + color: 'black', + } + }); + + diff --git a/LeftOvers/components/Separator.tsx b/LeftOvers/components/Separator.tsx index 12562c2..dbeae6f 100644 --- a/LeftOvers/components/Separator.tsx +++ b/LeftOvers/components/Separator.tsx @@ -7,7 +7,7 @@ export default function Separator (){ const styles = StyleSheet.create({ separator: { - width: 250, // Largeur de la ligne + width: 200, // Largeur de la ligne backgroundColor: 'black', // Couleur de la ligne borderWidth : 1, marginLeft : 10, diff --git a/LeftOvers/naviguation/parameter.png b/LeftOvers/naviguation/parameter.png new file mode 100644 index 0000000..08425b4 Binary files /dev/null and b/LeftOvers/naviguation/parameter.png differ