Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Created May 31, 2019 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchetaWern/525678ed9264077be918e67131e0d08f to your computer and use it in GitHub Desktop.
Save anchetaWern/525678ed9264077be918e67131e0d08f to your computer and use it in GitHub Desktop.
React Native Stream Group Chat Tutorial: Render user
// src/screens/Chat.js
renderUser = ({ item }) => {
const online_status = (item.user.online) ? 'online' : 'offline';
return (
<View style={styles.list_item_body}>
<View style={styles.list_item}>
<View style={styles.inline_contents}>
<View style={[styles.status_indicator, styles[online_status]]}></View>
<Text style={styles.list_item_text}>{item.user.name}</Text>
</View>
</View>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment