diff --git a/LeftOvers/App.tsx b/LeftOvers/App.tsx index fb00fc6..131b093 100644 --- a/LeftOvers/App.tsx +++ b/LeftOvers/App.tsx @@ -14,8 +14,8 @@ export default function App(props) { // // // - - // + // + // ); } \ No newline at end of file diff --git a/LeftOvers/components/ProfileDetails.tsx b/LeftOvers/components/ProfileDetails.tsx index 03923c5..ff07507 100644 --- a/LeftOvers/components/ProfileDetails.tsx +++ b/LeftOvers/components/ProfileDetails.tsx @@ -116,7 +116,7 @@ const styles = StyleSheet.create({ filterBar: { flexDirection: "row", - width: "90%", + width: "85%", paddingTop: "3%", paddingBottom: "1%", alignItems: "flex-end", diff --git a/LeftOvers/screens/FiltersSelection.tsx b/LeftOvers/screens/FiltersSelection.tsx index 3e6b2b0..642f92c 100644 --- a/LeftOvers/screens/FiltersSelection.tsx +++ b/LeftOvers/screens/FiltersSelection.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {StyleSheet, View, Text, ScrollView} from 'react-native'; +import {StyleSheet, View, Text, ScrollView, useWindowDimensions} from 'react-native'; import ProfileModification from '../components/ProfileModification'; import ValidateButton from '../components/ValidateButton'; import TopBar from '../components/TopBar'; @@ -17,53 +17,70 @@ export default function FiltersSelection(props) { {name: "David Martinez", avatar: "plus_small.png", isActive: "flex"}, ] + let cptActive = 0 + profiles.forEach(function (value) { + if(value.isActive=="flex"){ + cptActive=cptActive+1 + } + }) + const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}] const allProfiles = [{value: "Skimmed Milk"}, {value: "Nuts"}] const dieProfiles = [{value: "Porkless"}, {value: "Pescatarian"}] - const dieAdd = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Vegan"}, {value: "Vegetarian"}] + function isInProfileDiets(element, index, array) { + var retType = true + dieProfiles.forEach(function (diets) { + if(diets.value==element.value){ + retType = false + } + }) + return retType + } + const dieAdd = die.filter(isInProfileDiets); const allAdd = [] return ( + - - - + + Profiles - 2 selected, 1 waiting + {cptActive} selected, 1 waiting - + - + - + Filters from Profiles - + - + Additional Filters - 3 selected + {dieAdd.length} available - + - + - + + @@ -83,53 +100,45 @@ const styles = StyleSheet.create({ height: "100%", width: "100%", flex: 1, - padding: 10, + padding: "2%", paddingTop: 0, }, background: { - //maxWidth: 370, flexDirection: 'column', alignItems: 'center', justifyContent: 'center', borderRadius: 20, backgroundColor: '#F2F0E4', - padding: 10, - paddingBottom: 0, - marginHorizontal: 10, + padding: "3%", + marginHorizontal: "3%", }, + filterBar: { flexDirection: "row", - width: 300, - paddingTop: 10, - paddingBottom: 5, + width: "85%", + paddingTop: "3%", + paddingBottom: "2%", 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, + marginHorizontal: "3%", + paddingBottom: "3%", }, }); \ No newline at end of file