Skip to content

Commit

Permalink
bottom border color prop and option of no remove items selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Martínez committed Aug 10, 2021
1 parent 6f7597a commit e4c3db7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function SelectBox({
multiListEmptyLabelStyle,
listEmptyLabelStyle,
selectedItemStyle,
removeItemsSelected,
listEmptyText = 'No results found',
...props
}) {
Expand Down Expand Up @@ -112,14 +113,18 @@ function SelectBox({
const kMultiOptionsLabelStyle = {
fontSize: 10,
color: '#fff',
padding: 4,
marginRight: 5,
...multiOptionsLabelStyle,
}

return (
<View style={kMultiOptionContainerStyle}>
<Text style={kMultiOptionsLabelStyle}>{label.item}</Text>
<TouchableOpacity style={{ marginLeft: 15 }} hitSlop={hitSlop} onPress={onPressItem()}>
<Icon name="closeCircle" fill="#fff" width={21} height={21} />
</TouchableOpacity>
{ removeItemsSelected ?
<TouchableOpacity hitSlop={hitSlop} onPress={onPressItem()}>
<Icon name="closeCircle" fill="#fff" width={21} height={21} />
</TouchableOpacity> : null }
</View>
)

Expand All @@ -140,6 +145,7 @@ function SelectBox({
arrowIconColor = Colors.primary,
searchIconColor = Colors.primary,
toggleIconColor = Colors.primary,
bottomBarColor ='#ddd',
searchInputProps,
multiSelectInputFieldProps,
listOptionProps = {},
Expand Down Expand Up @@ -188,7 +194,7 @@ function SelectBox({
const kContainerStyle = {
flexDirection: 'row',
width: '100%',
borderColor: '#ddd',
borderColor: bottomBarColor,
borderBottomWidth: 1,
paddingTop: 6,
paddingRight: 20,
Expand Down Expand Up @@ -393,4 +399,4 @@ SelectBox.defaultProps = {
],
}

export default memo(SelectBox)
export default memo(SelectBox)

0 comments on commit e4c3db7

Please sign in to comment.