|
|
@ -1,4 +1,4 @@
|
|
|
|
import React from 'react';
|
|
|
|
import React, {useContext} from 'react';
|
|
|
|
import {StyleSheet, View, Text, ScrollView, useWindowDimensions} from 'react-native';
|
|
|
|
import {StyleSheet, View, Text, ScrollView, useWindowDimensions} from 'react-native';
|
|
|
|
import {LinearGradient} from 'expo-linear-gradient';
|
|
|
|
import {LinearGradient} from 'expo-linear-gradient';
|
|
|
|
import {SafeAreaProvider} from 'react-native-safe-area-context';
|
|
|
|
import {SafeAreaProvider} from 'react-native-safe-area-context';
|
|
|
@ -8,8 +8,10 @@ import TopBar from '../components/TopBar';
|
|
|
|
import ListSelect from '../components/ListSelect';
|
|
|
|
import ListSelect from '../components/ListSelect';
|
|
|
|
import ListWithoutSelect from '../components/ListWithoutSelect';
|
|
|
|
import ListWithoutSelect from '../components/ListWithoutSelect';
|
|
|
|
import ProfileSelection from '../components/ProfileSelection';
|
|
|
|
import ProfileSelection from '../components/ProfileSelection';
|
|
|
|
|
|
|
|
import ColorContext from '../theme/ColorContext';
|
|
|
|
|
|
|
|
|
|
|
|
export default function FiltersSelection(props) {
|
|
|
|
export default function FiltersSelection(props) {
|
|
|
|
|
|
|
|
const {colors, toggleColors} = useContext(ColorContext);
|
|
|
|
const profiles = [
|
|
|
|
const profiles = [
|
|
|
|
{name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"},
|
|
|
|
{name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"},
|
|
|
|
{name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"},
|
|
|
|
{name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"},
|
|
|
@ -41,53 +43,7 @@ export default function FiltersSelection(props) {
|
|
|
|
const dieAdd = die.filter(isInProfileDiets);
|
|
|
|
const dieAdd = die.filter(isInProfileDiets);
|
|
|
|
const allAdd = []
|
|
|
|
const allAdd = []
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
<SafeAreaProvider style={{flex: 1}}>
|
|
|
|
|
|
|
|
<TopBar title="Filters Selection" isVisible="true"/>
|
|
|
|
|
|
|
|
<ScrollView>
|
|
|
|
|
|
|
|
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<View style={styles.profilesSelection}>
|
|
|
|
|
|
|
|
<View style={styles.filterBar}>
|
|
|
|
|
|
|
|
<Text style={styles.filters}>Profiles</Text>
|
|
|
|
|
|
|
|
<Text style={styles.nbSelected}>{cptActive} selected, 1 waiting</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ProfileSelection listProfile={profiles} disableSelection={false}/>
|
|
|
|
|
|
|
|
<View style={{marginTop: "4%"}}/>
|
|
|
|
|
|
|
|
<ValidateButton title="Change Selected Profiles" image="update.png" colour="#59BDCD" backColour="#E3DEC9" todo={ () => console.log("change selected profile")}></ValidateButton>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<View style={styles.background}>
|
|
|
|
|
|
|
|
<View style={styles.filterBar}>
|
|
|
|
|
|
|
|
<Text style={styles.filters}>Filters from Profiles</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<ListWithoutSelect title="Diets" content={dieProfiles}></ListWithoutSelect>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ListWithoutSelect title="Allergies" content={allProfiles}></ListWithoutSelect>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<View style={styles.background}>
|
|
|
|
|
|
|
|
<View style={styles.filterBar}>
|
|
|
|
|
|
|
|
<Text style={styles.filters}>Additional Filters</Text>
|
|
|
|
|
|
|
|
<Text style={styles.nbSelected}>{dieAdd.length} available</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<ListSelect title="Diets" content={dieAdd}></ListSelect>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ListWithoutSelect title="Allergies" content={allAdd}></ListWithoutSelect>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ValidateButton title="Add Allergy" image="plus.png" colour="#59BDCD" backColour="#E3DEC9" todo={() => console.log("add allergy")}></ValidateButton>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<ValidateButton title="Save Filters" image="save.png" colour="#ACA279" backColour="#F2F0E4" todo={() => console.log("save filters")}></ValidateButton>
|
|
|
|
|
|
|
|
<View style={{marginTop: "20%"}}/>
|
|
|
|
|
|
|
|
</LinearGradient>
|
|
|
|
|
|
|
|
</ScrollView>
|
|
|
|
|
|
|
|
</SafeAreaProvider>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
|
|
|
container: {
|
|
|
|
container: {
|
|
|
|
height: "100%",
|
|
|
|
height: "100%",
|
|
|
|
width: "100%",
|
|
|
|
width: "100%",
|
|
|
@ -112,6 +68,8 @@ const styles = StyleSheet.create({
|
|
|
|
backgroundColor: '#F2F0E4',
|
|
|
|
backgroundColor: '#F2F0E4',
|
|
|
|
padding: "3%",
|
|
|
|
padding: "3%",
|
|
|
|
marginHorizontal: "3%",
|
|
|
|
marginHorizontal: "3%",
|
|
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
|
|
borderColor: colors.blocBorder,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
filterBar: {
|
|
|
|
filterBar: {
|
|
|
@ -140,5 +98,53 @@ const styles = StyleSheet.create({
|
|
|
|
backgroundColor: '#F2F0E4',
|
|
|
|
backgroundColor: '#F2F0E4',
|
|
|
|
marginHorizontal: "3%",
|
|
|
|
marginHorizontal: "3%",
|
|
|
|
paddingBottom: "3%",
|
|
|
|
paddingBottom: "3%",
|
|
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
|
|
borderColor: colors.blocBorder,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<SafeAreaProvider style={{flex: 1}}>
|
|
|
|
|
|
|
|
<TopBar title="Filters Selection" isVisible="true"/>
|
|
|
|
|
|
|
|
<ScrollView>
|
|
|
|
|
|
|
|
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<View style={styles.profilesSelection}>
|
|
|
|
|
|
|
|
<View style={styles.filterBar}>
|
|
|
|
|
|
|
|
<Text style={styles.filters}>Profiles</Text>
|
|
|
|
|
|
|
|
<Text style={styles.nbSelected}>{cptActive} selected, 1 waiting</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ProfileSelection listProfile={profiles} disableSelection={false}/>
|
|
|
|
|
|
|
|
<View style={{marginTop: "4%"}}/>
|
|
|
|
|
|
|
|
<ValidateButton title="Change Selected Profiles" image="update.png" colour="#59BDCD" backColour="#E3DEC9" todo={ () => console.log("change selected profile")}></ValidateButton>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<View style={styles.background}>
|
|
|
|
|
|
|
|
<View style={styles.filterBar}>
|
|
|
|
|
|
|
|
<Text style={styles.filters}>Filters from Profiles</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<ListWithoutSelect title="Diets" content={dieProfiles}></ListWithoutSelect>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ListWithoutSelect title="Allergies" content={allProfiles}></ListWithoutSelect>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<View style={styles.background}>
|
|
|
|
|
|
|
|
<View style={styles.filterBar}>
|
|
|
|
|
|
|
|
<Text style={styles.filters}>Additional Filters</Text>
|
|
|
|
|
|
|
|
<Text style={styles.nbSelected}>{dieAdd.length} available</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<ListSelect title="Diets" content={dieAdd}></ListSelect>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ListWithoutSelect title="Allergies" content={allAdd}></ListWithoutSelect>
|
|
|
|
|
|
|
|
<View style={{marginTop: "3%"}}/>
|
|
|
|
|
|
|
|
<ValidateButton title="Add Allergy" image="plus.png" colour="#59BDCD" backColour="#E3DEC9" todo={() => console.log("add allergy")}></ValidateButton>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginTop: "6%"}}/>
|
|
|
|
|
|
|
|
<ValidateButton title="Save Filters" image="save.png" colour="#ACA279" backColour="#F2F0E4" todo={() => console.log("save filters")}></ValidateButton>
|
|
|
|
|
|
|
|
<View style={{marginTop: "20%"}}/>
|
|
|
|
|
|
|
|
</LinearGradient>
|
|
|
|
|
|
|
|
</ScrollView>
|
|
|
|
|
|
|
|
</SafeAreaProvider>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|