diff --git a/LeftOvers/assets/images/cross.png b/LeftOvers/assets/images/cross.png new file mode 100644 index 0000000..19e410a Binary files /dev/null and b/LeftOvers/assets/images/cross.png differ diff --git a/LeftOvers/assets/images/validate.png b/LeftOvers/assets/images/validate.png new file mode 100644 index 0000000..c174ff4 Binary files /dev/null and b/LeftOvers/assets/images/validate.png differ diff --git a/LeftOvers/components/ProfileDelete.tsx b/LeftOvers/components/ProfileDelete.tsx new file mode 100644 index 0000000..9f8d002 --- /dev/null +++ b/LeftOvers/components/ProfileDelete.tsx @@ -0,0 +1,115 @@ +import {React, useState} from 'react'; +import {StyleSheet, Text, TextInput, View, Image, Pressable} from 'react-native'; +import ValidateButton from './ValidateButton'; +import ListWithoutSelect from './ListWithoutSelect'; + +type ProfileProps = { + name: string + avatar: string + diets: list + allergies: list +} + +export default function ProfileDelete(props: ProfileProps) { + const [display, setDisplay] = useState("flex") + const changeListVisibility = () => { + if (display == "none"){ + setDisplay("flex") + } + else{ + setDisplay("none") + } + }; + + return ( + + + + {props.name} + + + + Filters + + + + + + + + + + + ); +} + +const styles = StyleSheet.create({ + background: { + //maxWidth: 370, + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 15, + backgroundColor: '#F2F0E4', + padding: 10, + marginHorizontal: 10, + }, + pseudoBar: { + flexDirection: "row", + alignItems: "center", + justifyContent: "center", + flex: 0.7, + width: 330, + marginBottom: 10, + }, + avatar: { + padding: 20, + resizeMode: 'contain', + borderWidth: 2, + borderColor: "#ACA279", + borderRadius: 45, + }, + text: { + fontSize: 20, + color: '#ACA279', + alignItems: 'center', + justifyContent: 'left', + flex: 0.8, + marginLeft: 20, + padding: 5, + }, + + + + filterBar: { + flexDirection: "row", + width: 300, + paddingTop: 10, + paddingBottom: 5, + alignItems: "flex-end", + justifyContent: "center", + flex: 0.2, + }, + filters: { + flex: 0.5, + fontSize: 20, + color: '#ACA279', + flex: 1, + padding: 5, + paddingLeft: 0, + paddingBottom: 0, + }, + nbSelected: { + fontSize: 11, + flex: 1, + color: "#3F3C42", + textAlign: "right", + }, + arrow: { + height: 20, + width: 20, + resizeMode: 'contain', + tintColor: "#3F3C42", + flex: 0.1, + }, +}); \ No newline at end of file diff --git a/LeftOvers/components/ProfileDetails.tsx b/LeftOvers/components/ProfileDetails.tsx index 6fd6f8c..deb63f7 100644 --- a/LeftOvers/components/ProfileDetails.tsx +++ b/LeftOvers/components/ProfileDetails.tsx @@ -8,17 +8,18 @@ type ProfileProps = { avatar: string diets: list allergies: list + onDeleteProfile: () => void } export default function ProfileDetails(props: ProfileProps) { - const [display, setDisplay] = useState("none"); + const [display, setDisplay] = useState("none") const changeListVisibility = () => { - if (display == "none"){ + if (display == "none"){ setDisplay("flex") - } - else{ + } + else{ setDisplay("none") - } + } }; return ( @@ -27,7 +28,9 @@ export default function ProfileDetails(props: ProfileProps) { {props.name} - + + + diff --git a/LeftOvers/screens/Profiles.tsx b/LeftOvers/screens/Profiles.tsx index 6bb5ca2..0f2e83e 100644 --- a/LeftOvers/screens/Profiles.tsx +++ b/LeftOvers/screens/Profiles.tsx @@ -1,11 +1,10 @@ -import React from 'react'; -import {StyleSheet, View} from 'react-native'; -import ProfileModification from '../components/ProfileModification'; +import {React, useState} from 'react'; +import {StyleSheet, View, Modal, Pressable, Text, Image} from 'react-native'; import ProfileDetails from '../components/ProfileDetails'; -import ValidateButton from '../components/ValidateButton'; +import ProfileDelete from '../components/ProfileDelete'; import TopBar from '../components/TopBar'; -import { LinearGradient } from 'expo-linear-gradient'; -import { SafeAreaProvider } from 'react-native-safe-area-context'; +import {LinearGradient} from 'expo-linear-gradient'; +import {SafeAreaProvider} from 'react-native-safe-area-context'; export default function ModifyProfile(props) { const allJohnny = [{value: "Coconut"}, {value: "Skimmed Milk"}, {value: "Nuts"}] @@ -20,21 +19,62 @@ export default function ModifyProfile(props) { const allViktor = [{value: "Pasta"}, {value: "Fish"}] const dieViktor = [{value: "Dairy free"}, {value: "Vegan"}] + const [visible, setVisible] = useState(false); + const [opacity, setOpacity] = useState(1); + const raisePopUp = () => { + setVisible(true) + setOpacity(0.4) + } + const erasePopUp = () => { + setVisible(false) + setOpacity(1) + } + return ( - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + Do you really want to delete this profile? + + + + + Yes + + + + + + No + + + + + + + + + + ); @@ -56,4 +96,98 @@ const styles = StyleSheet.create({ padding: 10, paddingTop: 0, }, + + + + modal: { + position: 'absolute', + top: '50%', + left: '50%', + justifyContent: "center", + alignItems: "center", + width: "100%", + transform: [{ translateX: -207 }, { translateY: -140 }], + }, + viewModal: { + flexDirection: "column", + padding: 10, + alignItems: "center", + justifyContent: "center", + width: "100%", + height: 200, + }, + + + profileValidation: { + width: "100%", + alignItems: "center", + justifyContent: "center", + paddingBottom: 20, + }, + decisionBarVertical: { + flexDirection: "column", + width: "100%", + padding: 10, + height: "100%", + borderRadius: 15, + alignItems: "center", + justifyContent: "center", + backgroundColor: "#F2F0E4", + }, + validationQuestion: { + fontSize: 20, + color: '#ACA279', + alignItems: 'center', + justifyContent: 'center', + flex: 0.3, + padding: 5, + }, + decisionBar: { + flexDirection: "row", + flex: 0.7, + width: "100%", + height: "20%", + borderRadius: 15, + alignItems: "center", + justifyContent: "center", + backgroundColor: "#F2F0E4", + }, + yesButton: { + flexDirection: "row", + flex: 0.5, + padding: 10, + marginHorizontal: 10, + width: "90%", + borderRadius: 20, + alignItems: "center", + justifyContent: "center", + backgroundColor: "#59BDCD", + }, + yesText: { + fontSize: 20, + color: '#3F3C42', + alignItems: 'center', + justifyContent: 'center', + flex: 0.7, + padding: 5, + }, + noButton: { + flexDirection: "row", + flex: 0.5, + padding: 10, + marginHorizontal: 10, + width: "90%", + borderRadius: 20, + alignItems: "center", + justifyContent: "center", + backgroundColor: "#8A0000", + }, + noText: { + fontSize: 20, + color: '#F2F0E4', + alignItems: 'center', + justifyContent: 'center', + flex: 0.7, + padding: 5, + }, }); \ No newline at end of file