diff --git a/lib/components/ItemIcon.js b/lib/components/ItemIcon.js index e981837..c94c9ad 100644 --- a/lib/components/ItemIcon.js +++ b/lib/components/ItemIcon.js @@ -9,8 +9,8 @@ const ItemIcon = ({ iconRenderer: Icon, icon, iconKey, itemIconStyle }) => { source={icon} style={[ { - width: 32, - height: 32, + // width: 32, + // height: 32, marginHorizontal: 10 }, itemIconStyle diff --git a/lib/sectioned-multi-select.js b/lib/sectioned-multi-select.js index 3f69a2b..3db3e78 100644 --- a/lib/sectioned-multi-select.js +++ b/lib/sectioned-multi-select.js @@ -16,7 +16,8 @@ import { } from 'react-native' import isEqual from 'lodash.isequal' import memoize from 'memoize-one' -import { RowItem } from './components' +import { isEqual } from 'lodash' +import { RowItem, ItemIcon } from './components' import { callIfFunction } from './helpers' const Touchable = @@ -392,7 +393,7 @@ class SectionedMultiSelect extends PureComponent { else return null } - + return ( { const item = this._findItem(singleSelectedItem) @@ -966,8 +967,13 @@ class SectionedMultiSelect extends PureComponent { styles.chipContainer, isParent && styles.parentChipContainer ]} - key={item[uniqueKey]} - > + key={item[uniqueKey]}> + ) : ( - - ) + + ) } // _renderSubItemFlatList = ({ item }) => ( @@ -1222,30 +1228,30 @@ class SectionedMultiSelect extends PureComponent { {loading ? ( callIfFunction(loadingComponent) ) : ( - - {!renderItems || (!renderItems.length && !searchTerm) - ? callIfFunction(noItemsComponent) - : null} - {items && renderItems && renderItems.length ? ( - - `${item[uniqueKey]}`} - ItemSeparatorComponent={this._renderSeparator} - ListFooterComponent={this._renderFooter} - renderItem={this._renderItemFlatList} - {...itemsFlatListProps} - /> - - ) : searchTerm ? ( - callIfFunction(noResultsComponent) - ) : null} - - )} + + {!renderItems || (!renderItems.length && !searchTerm) + ? callIfFunction(noItemsComponent) + : null} + {items && renderItems && renderItems.length ? ( + + `${item[uniqueKey]}`} + ItemSeparatorComponent={this._renderSeparator} + ListFooterComponent={this._renderFooter} + renderItem={this._renderItemFlatList} + {...itemsFlatListProps} + /> + + ) : searchTerm ? ( + callIfFunction(noResultsComponent) + ) : null} + + )}