Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Commit 91fcbb8

Browse files
committed
update example
1 parent ab3b3e5 commit 91fcbb8

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

example/CellComponents/App.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ class App extends Component {
118118
});
119119
}
120120

121+
renderTag = (user, selected) => {
122+
return (
123+
<Text
124+
style={ [styles.tag, selected ? styles.tagSelected : null ]} >
125+
{user.name},
126+
</Text>
127+
);
128+
}
129+
121130
render() {
122131
return (
123132
<View style={styles.container} >
@@ -127,8 +136,9 @@ class App extends Component {
127136
<View style={styles.header} />
128137
<TagsInput
129138
ref={component => this._tagsInput = component}
130-
label="TO:"
131-
tags={this.state.selectedUsers.map((user) => user.name)}
139+
icon="group"
140+
tags={this.state.selectedUsers}
141+
renderTag={this.renderTag}
132142
onChangeText={this.handleUsersOnChangeText}
133143
onRemoveTag={this.handleUsersOnRemoveTag}
134144
/>
@@ -203,7 +213,7 @@ class App extends Component {
203213
itemTitle="name"
204214
itemSubtitle="email"
205215
onItemPress={this.handleUserItemOnPress}
206-
itemSelectedValidator="id"
216+
itemValidator="id"
207217
section="country"
208218
/>
209219
</View>
@@ -225,6 +235,13 @@ const styles = StyleSheet.create({
225235
flexDirection: 'row',
226236
alignItems: 'center',
227237
backgroundColor: '#fff',
238+
},
239+
tagSelected: {
240+
color: theme.color.white,
241+
},
242+
tag: {
243+
color: theme.color.info,
244+
fontSize: theme.font.medium
228245
}
229246
});
230247

0 commit comments

Comments
 (0)