diff --git a/LeftOvers/App.tsx b/LeftOvers/App.tsx index 530740c..150d43d 100644 --- a/LeftOvers/App.tsx +++ b/LeftOvers/App.tsx @@ -1,5 +1,6 @@ import React from 'react'; import {StyleSheet, View} from 'react-native'; +import HomePage from './screens/HomePage'; import ModifyProfile from './screens/ModifyProfile'; import Profiles from './screens/Profiles'; import RecipeSuggestion from './screens/RecipeSuggestion'; @@ -8,10 +9,11 @@ import FiltersSelection from './screens/FiltersSelection'; export default function App(props) { return( + // // // // - + // ); } \ No newline at end of file diff --git a/LeftOvers/assets/images/cook.png b/LeftOvers/assets/images/cook.png new file mode 100644 index 0000000..92b4470 Binary files /dev/null and b/LeftOvers/assets/images/cook.png differ diff --git a/LeftOvers/assets/images/logo.png b/LeftOvers/assets/images/logo.png new file mode 100644 index 0000000..1a29b13 Binary files /dev/null and b/LeftOvers/assets/images/logo.png differ diff --git a/LeftOvers/assets/images/search.png b/LeftOvers/assets/images/search.png new file mode 100644 index 0000000..5cdb198 Binary files /dev/null and b/LeftOvers/assets/images/search.png differ diff --git a/LeftOvers/assets/images/warehouse.png b/LeftOvers/assets/images/warehouse.png new file mode 100644 index 0000000..963141d Binary files /dev/null and b/LeftOvers/assets/images/warehouse.png differ diff --git a/LeftOvers/components/FoodElementText.tsx b/LeftOvers/components/FoodElementText.tsx index 1e3b028..1fe03c7 100644 --- a/LeftOvers/components/FoodElementText.tsx +++ b/LeftOvers/components/FoodElementText.tsx @@ -44,7 +44,6 @@ const styles = StyleSheet.create({ color: 'black', }, view: { - alignItems: 'flex-start', justifyContent: 'center', marginRight: 5 // Centre le contenu horizontalement diff --git a/LeftOvers/components/ProfileElement.tsx b/LeftOvers/components/ProfileElement.tsx index 8b158a2..614caa5 100644 --- a/LeftOvers/components/ProfileElement.tsx +++ b/LeftOvers/components/ProfileElement.tsx @@ -5,12 +5,16 @@ type Profile = { name: string avatar: string isActive: string + disableSelection: boolean } export default function ProfileElement(props : Profile) { const [waiting, setWaiting] = useState("none") const changeStatus = () => { - if (waiting == "flex"){ + if (props.disableSelection){ + setWaiting("none") + } + else if (waiting == "flex"){ setWaiting("none") } else{ diff --git a/LeftOvers/components/ProfileSelection.tsx b/LeftOvers/components/ProfileSelection.tsx index 6f824e8..832e727 100644 --- a/LeftOvers/components/ProfileSelection.tsx +++ b/LeftOvers/components/ProfileSelection.tsx @@ -5,14 +5,14 @@ import bracketRight from '../assets/images/angle_bracket_right.png'; import ProfileElement from './ProfileElement' type ProfileSelectionProps = { - listProfile: Profile[]; + listProfile: Profile[] + disableSelection: boolean } type Profile = { name: string avatar: string isActive: boolean - isWaiting: boolean } export default function ProfileSelection(props: ProfileSelectionProps) { @@ -39,7 +39,7 @@ export default function ProfileSelection(props: ProfileSelectionProps) { - + diff --git a/LeftOvers/screens/FiltersSelection.tsx b/LeftOvers/screens/FiltersSelection.tsx index 224f5ec..6a3f42b 100644 --- a/LeftOvers/screens/FiltersSelection.tsx +++ b/LeftOvers/screens/FiltersSelection.tsx @@ -33,11 +33,11 @@ export default function FiltersSelection(props) { - Filters + Profiles 2 selected, 1 waiting - + diff --git a/LeftOvers/screens/HomePage.tsx b/LeftOvers/screens/HomePage.tsx new file mode 100644 index 0000000..549988e --- /dev/null +++ b/LeftOvers/screens/HomePage.tsx @@ -0,0 +1,210 @@ +import {React, useState} from 'react'; +import {StyleSheet, View, Text, Pressable, Image} from 'react-native'; +import ProfileModification from '../components/ProfileModification'; +import ValidateButton from '../components/ValidateButton'; +import TopBar from '../components/TopBar'; +import ListSelect from '../components/ListSelect'; +import ListWithoutSelect from '../components/ListWithoutSelect'; +import ProfileSelection from '../components/ProfileSelection'; +import FoodElementText from '../components/FoodElementText'; +import {LinearGradient} from 'expo-linear-gradient'; +import {SafeAreaProvider} from 'react-native-safe-area-context'; +import bracketLeft from '../assets/images/angle_bracket_left.png'; +import bracketRight from '../assets/images/angle_bracket_right.png'; + +export default function HomePage(props) { + const profiles = [ + {name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"}, + {name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"}, + {name: "Goro Takemura", avatar: "plus_small.png", isActive: "none"}, + {name: "David Martinez", avatar: "plus_small.png", isActive: "flex"}, + ] + + const ingredientList = [{title: "Carrot"}, {title: "Potato"}, {title: "Peach"}] + + const [cpt, setCpt] = useState(0); + const decreaseCounter = () => { + if (cpt > 0) { + setCpt(cpt - 1); + } + else { + setCpt(ingredientList.length - 1); + } + }; + const increaseCounter = () => { + if (cpt < ingredientList.length - 1) { + setCpt(cpt + 1); + } + else { + setCpt(0); + } + }; + + return ( + + + + LeftOvers + + + + + + + + + Welcome + Rayhân + , + + Glad to see you again! + + + + + + Profiles + 2 selected + + + + + + + + + + Ingredient Stocks + + + + + + + + Cooking + + + + Selected Ingredient + + + + + + + + + + + + + + + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + height: "100%", + width: "100%", + flex: 1, + backgroundColor: '#3F3C42', + alignItems: 'center', + justifyContent: 'center', + }, + linearGradient: { + height: "100%", + width: "100%", + flex: 1, + padding: 10, + paddingTop: 0, + }, + + filterBar: { + flexDirection: "row", + width: 300, + paddingTop: 10, + paddingBottom: 5, + alignItems: "flex-end", + justifyContent: "center", + flex: 0.2, + }, + filters: { + flex: 0.8, + fontSize: 20, + color: '#ACA279', + flex: 1, + padding: 5, + paddingLeft: 0, + paddingBottom: 0, + }, + nbSelected: { + fontSize: 11, + //flex: 0.2, + color: "#3F3C42", + textAlign: "right", + }, + + profilesSelection: { + //maxWidth: 370, + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 20, + backgroundColor: '#F2F0E4', + marginHorizontal: 10, + }, + welcome: { + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 20, + backgroundColor: '#F2F0E4', + paddingVertical: 10, + paddingHorizontal: 25, + marginHorizontal: 10, + }, + text: { + fontSize: 20, + color: '#ACA279', + }, + name: { + fontSize: 20, + fontWeight: "bold", + color: '#59BDCD', + textAlign: "left", + }, + ingredientSelection: { + flexDirection: 'column', + width: "90%", + alignItems: 'center', + justifyContent: 'center', + borderRadius: 20, + backgroundColor: '#E3DEC9', + borderWidth: 2, + borderColor: "#ACA279", + marginHorizontal: 10, + padding: 5 + }, + + appName: { + fontSize: 20, + fontWeight: "bold", + color: '#3F3C42', + textAlign: "center", + flex: 0.8, + }, + topBar: { + flexDirection: 'row', + width: "100%", + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#F2F0E4', + padding: 5, + }, +}); \ No newline at end of file diff --git a/LeftOvers/screens/home.tsx b/LeftOvers/screens/home.tsx deleted file mode 100644 index e69de29..0000000