From ca0987dec201e29841ff9470f0089785c0ac4ec4 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Tue, 28 Mar 2023 11:50:56 -0400 Subject: [PATCH] Update variables to use proper naming --- .../features/group/components/group-relationship.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/soapbox/features/group/components/group-relationship.tsx b/app/soapbox/features/group/components/group-relationship.tsx index 6b79ecda5..c71adbbe8 100644 --- a/app/soapbox/features/group/components/group-relationship.tsx +++ b/app/soapbox/features/group/components/group-relationship.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { HStack, Icon, Text } from 'soapbox/components/ui'; +import { GroupRoles } from 'soapbox/schemas/group-member'; import { Group } from 'soapbox/types/entities'; interface IGroupRelationship { @@ -9,10 +10,10 @@ interface IGroupRelationship { } const GroupRelationship = ({ group }: IGroupRelationship) => { - const isAdmin = group.relationship?.role === 'admin'; - const isModerator = group.relationship?.role === 'moderator'; + const isOwner = group.relationship?.role === GroupRoles.OWNER; + const isAdmin = group.relationship?.role === GroupRoles.ADMIN; - if (!isAdmin || !isModerator) { + if (!isOwner || !isAdmin) { return null; } @@ -21,14 +22,14 @@ const GroupRelationship = ({ group }: IGroupRelationship) => { - {isAdmin + {isOwner ? : }