Fix ListWithoutSelect component
continuous-integration/drone/push Build is passing Details

pull/20/head
Louison PARANT 1 year ago
parent e33f58258b
commit 227395ea14

@ -5,7 +5,7 @@ import ColorContext from '../theme/ColorContext';
type ListProps = { type ListProps = {
title: string title: string
content : string[] content : {value: string}[]
} }
export default function ListSelect(props: ListProps) { export default function ListSelect(props: ListProps) {
@ -74,7 +74,7 @@ export default function ListSelect(props: ListProps) {
}, },
badgesText: { badgesText: {
fontSize: 15, fontSize: 15,
color: colors.cardElementText, color: colors.badgeText,
}, },
box: { box: {
borderColor: "#3F3C42" borderColor: "#3F3C42"
@ -98,6 +98,7 @@ export default function ListSelect(props: ListProps) {
checkBoxStyles={styles.box} checkBoxStyles={styles.box}
notFoundText="All Diets Already Selected" notFoundText="All Diets Already Selected"
placeholder={props.title} placeholder={props.title}
labelStyles={styles.title}
label={props.title}/> label={props.title}/>
); );
} }

@ -9,8 +9,15 @@ type ListProps = {
} }
export default function ListWithoutSelect(props: ListProps) { export default function ListWithoutSelect(props: ListProps) {
const [selected, setSelected] = React.useState([]);
const { colors } = useContext(ColorContext); const { colors } = useContext(ColorContext);
let listContent = []
props.content.forEach((val) => {
listContent.push({value: val.value, disabled: true})
})
const styles = StyleSheet.create({ const styles = StyleSheet.create({
titleBar: { titleBar: {
flexDirection: "row", flexDirection: "row",
@ -58,6 +65,7 @@ export default function ListWithoutSelect(props: ListProps) {
width: "100%", width: "100%",
minWidth: 250, minWidth: 250,
maxWidth: 250, maxWidth: 250,
backgroundColor: colors.cardElementBackground,
}, },
itemText: { itemText: {
fontSize: 13, fontSize: 13,
@ -71,12 +79,14 @@ export default function ListWithoutSelect(props: ListProps) {
box: { box: {
borderWidth: 0, borderWidth: 0,
flex: 0, flex: 0,
backgroundColor: colors.cardElementBackground,
} }
}); });
return ( return (
<MultipleSelectList <MultipleSelectList
data={props.content} setSelected={(val) => setSelected(val)}
data={listContent}
save="value" save="value"
search={false} search={false}
arrowicon={<Image source={require("../assets/images/arrow.png")} style={styles.arrow}></Image>} arrowicon={<Image source={require("../assets/images/arrow.png")} style={styles.arrow}></Image>}
@ -84,8 +94,11 @@ export default function ListWithoutSelect(props: ListProps) {
inputStyles={styles.title} inputStyles={styles.title}
dropdownStyles={styles.itemList} dropdownStyles={styles.itemList}
dropdownItemStyles={styles.itemCell} dropdownItemStyles={styles.itemCell}
disabledItemStyles={styles.itemCell}
dropdownTextStyles={styles.itemText} dropdownTextStyles={styles.itemText}
disabledTextStyles={styles.itemText}
checkBoxStyles={styles.box} checkBoxStyles={styles.box}
disabledCheckBoxStyles={styles.box}
notFoundText="None" notFoundText="None"
placeholder={props.title} placeholder={props.title}
label={props.title}/> label={props.title}/>

@ -9,8 +9,8 @@ import ColorContext from '../theme/ColorContext';
type ProfileProps = { type ProfileProps = {
name: string name: string
avatar: string avatar: string
diets: string[] diets: {value: string}[]
allergies: string[] allergies: {value: string}[]
} }
export default function ProfileModification(props: ProfileProps) { export default function ProfileModification(props: ProfileProps) {

@ -37,6 +37,7 @@ export interface Theme {
yesButton: string, yesButton: string,
letterFilter: string, letterFilter: string,
foodElementBorder: string, foodElementBorder: string,
badgeText: string,
} }
export const LightTheme : Theme = { export const LightTheme : Theme = {
@ -66,6 +67,7 @@ export const LightTheme : Theme = {
yesButton: Moonstone, yesButton: Moonstone,
letterFilter: Moonstone, letterFilter: Moonstone,
foodElementBorder: Jet, foodElementBorder: Jet,
badgeText: Jet,
} }
export const DarkTheme : Theme = { export const DarkTheme : Theme = {
@ -95,5 +97,6 @@ export const DarkTheme : Theme = {
yesButton: CarolinaBlue, yesButton: CarolinaBlue,
letterFilter: CarolinaBlue, letterFilter: CarolinaBlue,
foodElementBorder: CarolinaBlue, foodElementBorder: CarolinaBlue,
badgeText: Alabaster,
} }

Loading…
Cancel
Save