diff --git a/LeftOvers/App.js b/LeftOvers/App.js index 2cb99a4..030483c 100644 --- a/LeftOvers/App.js +++ b/LeftOvers/App.js @@ -1,15 +1,22 @@ -import { StatusBar } from 'expo-status-bar'; import React from 'react'; -import { StyleSheet, Text, View, Alert } from 'react-native'; -import CustomButton from './components/CustomButton'; -import FoodElementText from './components/FoodElementText'; +import { StyleSheet, View } from 'react-native'; +import RecipeElementImage from './components/RecipeElementImage'; + +const generateImageList = () => { + const imageList = []; + const meat = '../assets/images/meat.png'; + for (let i = 0; i < 5; i++) { + imageList.push(meat); + } + return imageList; +}; export default function App() { + const imageList = []; return ( - - + ); } diff --git a/LeftOvers/assets/images/Background.png b/LeftOvers/assets/images/Background.png new file mode 100644 index 0000000..f18df96 Binary files /dev/null and b/LeftOvers/assets/images/Background.png differ diff --git a/LeftOvers/assets/images/Union_left.png b/LeftOvers/assets/images/Union_left.png new file mode 100644 index 0000000..f2cce5e Binary files /dev/null and b/LeftOvers/assets/images/Union_left.png differ diff --git a/LeftOvers/assets/images/Union_right.png b/LeftOvers/assets/images/Union_right.png new file mode 100644 index 0000000..0d7177d Binary files /dev/null and b/LeftOvers/assets/images/Union_right.png differ diff --git a/LeftOvers/assets/images/brochette.png b/LeftOvers/assets/images/brochette.png new file mode 100644 index 0000000..6cac01a Binary files /dev/null and b/LeftOvers/assets/images/brochette.png differ diff --git a/LeftOvers/assets/images/meat.png b/LeftOvers/assets/images/meat.png new file mode 100644 index 0000000..f346ca9 Binary files /dev/null and b/LeftOvers/assets/images/meat.png differ diff --git a/LeftOvers/components/CustomButton.tsx b/LeftOvers/components/CustomButton.tsx index 5f99086..ea913d1 100644 --- a/LeftOvers/components/CustomButton.tsx +++ b/LeftOvers/components/CustomButton.tsx @@ -2,6 +2,11 @@ import React from 'react'; import {StyleSheet,Pressable, Text, View} from 'react-native'; +interface CustomButtonProps { + source : string + title : string +} + export default function CustomButton(props) { return ( diff --git a/LeftOvers/components/FoodElementText.tsx b/LeftOvers/components/FoodElementText.tsx index 5f3cf9e..2e6062c 100644 --- a/LeftOvers/components/FoodElementText.tsx +++ b/LeftOvers/components/FoodElementText.tsx @@ -4,7 +4,15 @@ import Separator from '../components/Separator'; import plus from '../assets/images/plus.png'; import moins from '../assets/images/minus.png'; -export default function FoodElementText(props) { + + +interface foodElementImageProps { + source : string + title : string +} + + +export default function FoodElementText(props : any) { return ( @@ -27,7 +35,7 @@ const styles = StyleSheet.create({ height: 60, borderRadius: 5, elevation: 3, - backgroundColor: '#ACA279', + backgroundColor: '#E3DEC9', }, text: { fontSize: 15, diff --git a/LeftOvers/components/RecipeElementImage.tsx b/LeftOvers/components/RecipeElementImage.tsx new file mode 100644 index 0000000..f869d72 --- /dev/null +++ b/LeftOvers/components/RecipeElementImage.tsx @@ -0,0 +1,97 @@ +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'; + + +interface recipeElementImageProps { + number : number + title : string + description : string + imageList : string[] +} + +export default function RecipeElementImage(props : any) { + return ( + + + {props.number} + {props.title} + + {props.imageList.length > 0 ? ( + + + Ingredients + + + ) : null} + + + {props.imageList.length > 0 && props.imageList.map((source, index) => ( + + ))} + + + + {props.description} + + + + + ); +} + +const styles = StyleSheet.create({ + button: { + alignItems: 'center', + justifyContent: 'center', + width : 250, + height: 350, + borderRadius: 40, + elevation: 3, + backgroundColor: '#E3DEC9', + }, + text: { + fontSize: 14, + lineHeight: 21, + fontWeight: 'bold', + letterSpacing: 0.25, + color: '#756C28', + marginTop: 10, + }, + smallText: { + fontSize: 12, + lineHeight: 21, + fontWeight: 'bold', + letterSpacing: 0.25, + color: '#71662A', + textAlign: "center", + marginTop: 5, + }, + title:{ + fontSize: 18, + lineHeight: 21, + fontWeight: 'bold', + letterSpacing: 0.25, + color: '#524B1A', + }, + view: { + width : 240, + height: 340, + borderRadius: 40, + elevation: 3, + borderWidth: 2, + borderColor: 'grey', + alignItems: 'center', // Centre le contenu verticalement + display: "flex", + flexWrap: "wrap", + }, + horizontalAlignement: { + display: "flex", + flexDirection : 'row', + alignItems: 'center', + marginTop: 10, + } +}); \ No newline at end of file diff --git a/LeftOvers/components/image_ingredient_component.tsx b/LeftOvers/components/image_ingredient_component.tsx deleted file mode 100644 index e69de29..0000000