Skip to content

Commit

Permalink
Merge pull request #982 from akvo/feature/981-selected-items
Browse files Browse the repository at this point in the history
[#981] Update selected style
  • Loading branch information
dedenbangkit authored Jan 18, 2024
2 parents 1780d61 + 5f7d877 commit 0a52213
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/src/form/fields/TypeMultipleOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { styles } from '../styles';
import { MultiSelect } from 'react-native-element-dropdown';
import { FormState } from '../../store';
import { Text } from 'react-native';
import { Icon } from '@rneui/themed';
import { i18n } from '../../lib';

const TypeMultipleOption = ({
Expand Down Expand Up @@ -45,18 +44,18 @@ const TypeMultipleOption = ({
onChange(id, value);
}
}}
renderItem={(item) => {
renderItem={({ label, color, name }, active) => {
return (
<View style={[{ backgroundColor: item?.color || '#FFF', padding: 15 }]}>
<View style={[{ backgroundColor: active ? '#0047AB' : color || '#FFF', padding: 15 }]}>
<Text
style={[
{
color: item?.color ? '#FFF' : '#000',
fontWeight: item?.color ? 'bold' : 'normal',
color: color ? '#FFF' : '#000',
fontWeight: color ? 'bold' : 'normal',
},
]}
>
{item?.label || item?.name}
{label || name}
</Text>
</View>
);
Expand Down

0 comments on commit 0a52213

Please sign in to comment.