Skip to content

Commit

Permalink
Merge pull request #1 from periabyte/periabyte-custom-delete-icon
Browse files Browse the repository at this point in the history
added option to replace delete icon
  • Loading branch information
periabyte authored Dec 18, 2019
2 parents de3a304 + a2dae06 commit cd97655
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class Tags extends React.Component {
tagsViewStyle,
updateState,
keysForTag,
deleteElement,
deleteIconStyles,
customElement,
} = this.props;
Expand Down Expand Up @@ -156,10 +157,12 @@ class Tags extends React.Component {
>
<Text style={StyleSheet.flatten([styles.tagText, tagTextStyle])}>{item}</Text>
<TouchableHighlight onPress={() => this.deleteTag(count, tags, updateState) }>
<Image
source={require('./assets/close.png')}
style={StyleSheet.flatten([styles.deleteIcon, deleteIconStyles])}
/>
{deleteElement ? deleteElement : (
<Image
source={require('./assets/close.png')}
style={StyleSheet.flatten([styles.deleteIcon, deleteIconStyles])}
/>
)}
</TouchableHighlight>
</View>
)
Expand Down Expand Up @@ -256,4 +259,4 @@ const styles = {
}
};

export default Tags;
export default Tags;

0 comments on commit cd97655

Please sign in to comment.