Only owners can edit tags
This commit is contained in:
@ -39,8 +39,6 @@ const GroupTagListItem = (props: IGroupMemberListItem) => {
|
||||
const { updateGroupTag } = useUpdateGroupTag(group.id, tag.id);
|
||||
|
||||
const isOwner = group.relationship?.role === GroupRoles.OWNER;
|
||||
const isAdmin = group.relationship?.role === GroupRoles.ADMIN;
|
||||
const canEdit = isOwner || isAdmin;
|
||||
|
||||
const toggleVisibility = () => {
|
||||
updateGroupTag({
|
||||
@ -127,12 +125,12 @@ const GroupTagListItem = (props: IGroupMemberListItem) => {
|
||||
<Stack>
|
||||
<Text
|
||||
weight='bold'
|
||||
theme={(tag.visible || !canEdit) ? 'default' : 'subtle'}
|
||||
theme={(tag.visible || !isOwner) ? 'default' : 'subtle'}
|
||||
className='group-hover:underline'
|
||||
>
|
||||
#{tag.name}
|
||||
</Text>
|
||||
<Text size='sm' theme={(tag.visible || !canEdit) ? 'muted' : 'subtle'}>
|
||||
<Text size='sm' theme={(tag.visible || !isOwner) ? 'muted' : 'subtle'}>
|
||||
{intl.formatMessage(messages.total)}:
|
||||
{' '}
|
||||
<Text size='sm' theme='inherit' weight='semibold' tag='span'>
|
||||
@ -142,7 +140,7 @@ const GroupTagListItem = (props: IGroupMemberListItem) => {
|
||||
</Stack>
|
||||
</Link>
|
||||
|
||||
{canEdit ? (
|
||||
{isOwner ? (
|
||||
<HStack alignItems='center' space={2}>
|
||||
{tag.visible ? (
|
||||
renderPinIcon()
|
||||
|
||||
Reference in New Issue
Block a user