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
@ -88,10 +88,12 @@ class GroupHeader extends ImmutablePureComponent {
|
|||||||
const coverSrc = !!group ? group.get('cover_image_url') : ''
|
const coverSrc = !!group ? group.get('cover_image_url') : ''
|
||||||
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) {
|
||||||
@ -136,16 +138,19 @@ class GroupHeader extends ImmutablePureComponent {
|
|||||||
</Text>
|
</Text>
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
|
|
||||||
<Button
|
{
|
||||||
radiusSmall
|
isAdmin &&
|
||||||
color='primary'
|
<Button
|
||||||
backgroundColor='tertiary'
|
radiusSmall
|
||||||
className={_s.mr5}
|
color='primary'
|
||||||
icon='ellipsis'
|
backgroundColor='tertiary'
|
||||||
onClick={this.handleOnOpenGroupOptions}
|
className={_s.mr5}
|
||||||
buttonRef={this.setInfoBtn}
|
icon='ellipsis'
|
||||||
/>
|
onClick={this.handleOnOpenGroupOptions}
|
||||||
|
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,15 +191,18 @@ class GroupHeader extends ImmutablePureComponent {
|
|||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
|
|
||||||
<Button
|
{
|
||||||
radiusSmall
|
isAdmin &&
|
||||||
color='primary'
|
<Button
|
||||||
backgroundColor='tertiary'
|
radiusSmall
|
||||||
className={_s.mr5}
|
color='primary'
|
||||||
icon='ellipsis'
|
backgroundColor='tertiary'
|
||||||
onClick={this.handleOnOpenGroupOptions}
|
className={_s.mr5}
|
||||||
buttonRef={this.setInfoBtn}
|
icon='ellipsis'
|
||||||
/>
|
onClick={this.handleOnOpenGroupOptions}
|
||||||
|
buttonRef={this.setInfoBtn}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user