Display custom fields on user info (#476)
* Render custom fields on user info * renderCustomFields fix * Display custom fields in user info * Fix lint error
This commit is contained in:
parent
2d7360f077
commit
3502d4514b
|
@ -245,6 +245,32 @@ export default class RoomInfoView extends LoggedView {
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
renderCustomFields = (userId) => {
|
||||||
|
const { activeUsers } = this.props;
|
||||||
|
if (activeUsers[userId]) {
|
||||||
|
const { customFields } = activeUsers[userId];
|
||||||
|
|
||||||
|
if (!customFields) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
Object.keys(customFields).map((title) => {
|
||||||
|
if (!customFields[title]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<View style={styles.item} key={title}>
|
||||||
|
<Text style={styles.itemLabel}>{title}</Text>
|
||||||
|
<Text style={styles.itemContent}>{customFields[title]}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { room, roomUser } = this.state;
|
const { room, roomUser } = this.state;
|
||||||
if (!room) {
|
if (!room) {
|
||||||
|
@ -262,6 +288,7 @@ export default class RoomInfoView extends LoggedView {
|
||||||
{!this.isDirect() ? this.renderItem('announcement', room) : null}
|
{!this.isDirect() ? this.renderItem('announcement', room) : null}
|
||||||
{this.isDirect() ? this.renderRoles() : null}
|
{this.isDirect() ? this.renderRoles() : null}
|
||||||
{this.isDirect() ? this.renderTimezone(roomUser._id) : null}
|
{this.isDirect() ? this.renderTimezone(roomUser._id) : null}
|
||||||
|
{this.isDirect() ? this.renderCustomFields(roomUser._id) : null}
|
||||||
{room.broadcast ? this.renderBroadcast() : null}
|
{room.broadcast ? this.renderBroadcast() : null}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue