Created
May 31, 2019 09:07
-
-
Save anchetaWern/525678ed9264077be918e67131e0d08f to your computer and use it in GitHub Desktop.
React Native Stream Group Chat Tutorial: Render user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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