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