Skip to content

Commit

Permalink
#1537 | Display all the groups and household, a member belongs to.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsanadi6 committed Dec 2, 2024
1 parent 537377c commit d79da45
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions packages/openchs-android/src/views/common/IndividualProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,24 @@ class IndividualProfile extends AbstractComponent {
}

renderMenu(groupActions) {
return <Menu
ref={this.setMenuRef}
button={<TouchableOpacity onPress={this.showMenu}>
<MaterialIcon
name='more-vert'
size={25}
color={Colors.TextOnPrimaryColor}/>
</TouchableOpacity>}>
<MenuItem onPress={_.noop} disabled disabledTextColor={Colors.DefaultPrimaryColor}>Member of
groups:</MenuItem>
{groupActions.map(({fn, label}) => (
<MenuItem onPress={fn} textStyle={{color: Colors.Complimentary}}>{label}</MenuItem>))}
</Menu>;
return <View style={{ flexDirection: 'row', justifyContent: 'flex-end', flexWrap: 'wrap',}}>
{groupActions.map((groupAction) => {
const label = groupAction.isHousehold ? 'household' : 'group';
return (
<TouchableOpacity onPress={groupAction.fn} style={{
paddingVertical: 1,
paddingHorizontal: 7,
marginEnd: 10,
alignItems: 'center',
backgroundColor: Styles.greyBackground,
borderRadius: 5,
marginBottom: 5
}}>
<Text style={{color: Styles.accentColor}}>{`${groupAction.label} ${this.I18n.t(label)}`}</Text>
</TouchableOpacity>
)
})}
</View>
}

renderCommentIcon() {
Expand Down

0 comments on commit d79da45

Please sign in to comment.