Only owners can edit tags

environments/review-tag-improv-znizn8/deployments/3226
Chewbacca 2023-04-21 09:36:08 -04:00
rodzic 67a5240e43
commit 7842f8e7dc
1 zmienionych plików z 3 dodań i 5 usunięć

Wyświetl plik

@ -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()