Updated groups header to allow only admin to access options

• Updated:
- groups header to allow only admin to access options
This commit is contained in:
mgabdev 2020-06-10 23:25:08 -04:00
parent e09265279d
commit aa220c08e4

@ -89,9 +89,11 @@ class GroupHeader extends ImmutablePureComponent {
const coverSrcMissing = coverSrc.indexOf(PLACEHOLDER_MISSING_HEADER_SRC) > -1 || !coverSrc
const title = !!group ? group.get('title') : undefined
let isAdmin = false
let actionButtonTitle
let actionButtonOptions = {}
if (relationships) {
isAdmin = relationships.get('admin')
const isMember = relationships.get('member')
actionButtonTitle = intl.formatMessage(!isMember ? messages.join : messages.leave)
if (isMember) {
@ -137,6 +139,8 @@ class GroupHeader extends ImmutablePureComponent {
</Button>
}
{
isAdmin &&
<Button
radiusSmall
color='primary'
@ -146,6 +150,7 @@ class GroupHeader extends ImmutablePureComponent {
onClick={this.handleOnOpenGroupOptions}
buttonRef={this.setInfoBtn}
/>
}
</div>
<div className={[_s.default, _s.flexRow, _s.height100PC, _s.mt15, _s.pt10, _s.px10].join(' ')}>
@ -186,6 +191,8 @@ class GroupHeader extends ImmutablePureComponent {
</Button>
}
{
isAdmin &&
<Button
radiusSmall
color='primary'
@ -195,6 +202,7 @@ class GroupHeader extends ImmutablePureComponent {
onClick={this.handleOnOpenGroupOptions}
buttonRef={this.setInfoBtn}
/>
}
</div>
</div>
</div>