|
|
@ -1,8 +1,9 @@
|
|
|
|
import React from 'react';
|
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import {StyleSheet, Text, TextInput, View, Image, FlatList} from 'react-native';
|
|
|
|
import {StyleSheet, Text, TextInput, View, Image, FlatList} from 'react-native';
|
|
|
|
import ValidateButton from './ValidateButton';
|
|
|
|
import ValidateButton from './ValidateButton';
|
|
|
|
import HeaderFlatList from './HeaderFlatList';
|
|
|
|
import HeaderFlatList from './HeaderFlatList';
|
|
|
|
import { MultipleSelectList, SelectList } from 'react-native-dropdown-select-list'
|
|
|
|
import { MultipleSelectList, SelectList } from 'react-native-dropdown-select-list'
|
|
|
|
|
|
|
|
import ColorContext from '../theme/ColorContext';
|
|
|
|
|
|
|
|
|
|
|
|
type ListProps = {
|
|
|
|
type ListProps = {
|
|
|
|
title: string
|
|
|
|
title: string
|
|
|
@ -11,38 +12,19 @@ type ListProps = {
|
|
|
|
|
|
|
|
|
|
|
|
export default function ListSelect(props: ListProps) {
|
|
|
|
export default function ListSelect(props: ListProps) {
|
|
|
|
const [selected, setSelected] = React.useState([]);
|
|
|
|
const [selected, setSelected] = React.useState([]);
|
|
|
|
return (
|
|
|
|
const { colors, toggleColors } = useContext(ColorContext);
|
|
|
|
<MultipleSelectList
|
|
|
|
|
|
|
|
setSelected={(val) => setSelected(val)}
|
|
|
|
|
|
|
|
data={props.content}
|
|
|
|
|
|
|
|
save="value"
|
|
|
|
|
|
|
|
search={false}
|
|
|
|
|
|
|
|
arrowicon={<Image source={require("../assets/images/arrow.png")} style={styles.arrow}></Image>}
|
|
|
|
|
|
|
|
boxStyles={styles.titleBar}
|
|
|
|
|
|
|
|
inputStyles={styles.title}
|
|
|
|
|
|
|
|
dropdownStyles={styles.itemList}
|
|
|
|
|
|
|
|
dropdownItemStyles={styles.itemCell}
|
|
|
|
|
|
|
|
dropdownTextStyles={styles.itemText}
|
|
|
|
|
|
|
|
badgeStyles={styles.badges}
|
|
|
|
|
|
|
|
badgeTextStyles={styles.badgesText}
|
|
|
|
|
|
|
|
notFoundText="All Diets Already Selected"
|
|
|
|
|
|
|
|
placeholder={props.title}
|
|
|
|
|
|
|
|
label={props.title}/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
titleBar: {
|
|
|
|
titleBar: {
|
|
|
|
flexDirection: "row",
|
|
|
|
flexDirection: "row",
|
|
|
|
alignItems: "center",
|
|
|
|
alignItems: "center",
|
|
|
|
justifyContent: "stretch",
|
|
|
|
backgroundColor: colors.cardElementTitleBackground,
|
|
|
|
backgroundColor: "#F2F0E4",
|
|
|
|
|
|
|
|
borderTopRightRadius: 15,
|
|
|
|
borderTopRightRadius: 15,
|
|
|
|
borderTopLeftRadius: 15,
|
|
|
|
borderTopLeftRadius: 15,
|
|
|
|
borderBottomRightRadius: 0,
|
|
|
|
borderBottomRightRadius: 0,
|
|
|
|
borderBottomLeftRadius: 0,
|
|
|
|
borderBottomLeftRadius: 0,
|
|
|
|
borderWidth: 2,
|
|
|
|
borderWidth: 2,
|
|
|
|
borderColor: "#ACA279",
|
|
|
|
borderColor: colors.cardElementBorder,
|
|
|
|
minWidth: "92%",
|
|
|
|
minWidth: "92%",
|
|
|
|
maxWidth: "92%",
|
|
|
|
maxWidth: "92%",
|
|
|
|
marginBottom: 0,
|
|
|
|
marginBottom: 0,
|
|
|
@ -50,12 +32,12 @@ const styles = StyleSheet.create({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
arrow: {
|
|
|
|
arrow: {
|
|
|
|
resizeMode: 'contain',
|
|
|
|
resizeMode: 'contain',
|
|
|
|
tintColor: "#3F3C42",
|
|
|
|
tintColor: colors.cardElementTitle,
|
|
|
|
flex: 0.1,
|
|
|
|
flex: 0.1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
title: {
|
|
|
|
fontSize: 15,
|
|
|
|
fontSize: 15,
|
|
|
|
color: '#3F3C42',
|
|
|
|
color: colors.cardElementTitle,
|
|
|
|
alignItems: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
textAlign: "left",
|
|
|
|
textAlign: "left",
|
|
|
|
flex: 0.9,
|
|
|
|
flex: 0.9,
|
|
|
@ -64,13 +46,12 @@ const styles = StyleSheet.create({
|
|
|
|
itemList: {
|
|
|
|
itemList: {
|
|
|
|
flexDirection: "row",
|
|
|
|
flexDirection: "row",
|
|
|
|
alignItems: "flex-start",
|
|
|
|
alignItems: "flex-start",
|
|
|
|
justifyContent: "stretch",
|
|
|
|
|
|
|
|
borderWidth: 0,
|
|
|
|
borderWidth: 0,
|
|
|
|
borderTopRightRadius: 0,
|
|
|
|
borderTopRightRadius: 0,
|
|
|
|
borderTopLeftRadius: 0,
|
|
|
|
borderTopLeftRadius: 0,
|
|
|
|
borderBottomRightRadius: 15,
|
|
|
|
borderBottomRightRadius: 15,
|
|
|
|
borderBottomLeftRadius: 15,
|
|
|
|
borderBottomLeftRadius: 15,
|
|
|
|
backgroundColor: "#E3DEC9",
|
|
|
|
backgroundColor: colors.cardElementBackground,
|
|
|
|
minWidth: "92%",
|
|
|
|
minWidth: "92%",
|
|
|
|
maxWidth: "92%",
|
|
|
|
maxWidth: "92%",
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -87,14 +68,35 @@ const styles = StyleSheet.create({
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
padding: "1%",
|
|
|
|
padding: "1%",
|
|
|
|
paddingLeft: "3%",
|
|
|
|
paddingLeft: "3%",
|
|
|
|
color: "#3F3C42",
|
|
|
|
color: colors.cardElementText,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
badges: {
|
|
|
|
badges: {
|
|
|
|
backgroundColor: "#59BDCD",
|
|
|
|
backgroundColor: colors.cardElementBackground,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
badgesText: {
|
|
|
|
badgesText: {
|
|
|
|
fontSize: 15,
|
|
|
|
fontSize: 15,
|
|
|
|
color: "#F2F0E4",
|
|
|
|
color: colors.cardElementText,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<MultipleSelectList
|
|
|
|
|
|
|
|
setSelected={(val) => setSelected(val)}
|
|
|
|
|
|
|
|
data={props.content}
|
|
|
|
|
|
|
|
save="value"
|
|
|
|
|
|
|
|
search={false}
|
|
|
|
|
|
|
|
arrowicon={<Image source={require("../assets/images/arrow.png")} style={styles.arrow}></Image>}
|
|
|
|
|
|
|
|
boxStyles={styles.titleBar}
|
|
|
|
|
|
|
|
inputStyles={styles.title}
|
|
|
|
|
|
|
|
dropdownStyles={styles.itemList}
|
|
|
|
|
|
|
|
dropdownItemStyles={styles.itemCell}
|
|
|
|
|
|
|
|
dropdownTextStyles={styles.itemText}
|
|
|
|
|
|
|
|
badgeStyles={styles.badges}
|
|
|
|
|
|
|
|
badgeTextStyles={styles.badgesText}
|
|
|
|
|
|
|
|
notFoundText="All Diets Already Selected"
|
|
|
|
|
|
|
|
placeholder={props.title}
|
|
|
|
|
|
|
|
label={props.title}/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|