From 3a12b316d9d177c177d45f5cae08b7216f931e84 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 20 Mar 2023 20:02:58 -0500 Subject: [PATCH] GroupPage: add pending members counter --- app/soapbox/pages/group-page.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/soapbox/pages/group-page.tsx b/app/soapbox/pages/group-page.tsx index bc7144f10..954df3a00 100644 --- a/app/soapbox/pages/group-page.tsx +++ b/app/soapbox/pages/group-page.tsx @@ -12,6 +12,7 @@ import { SignUpPanel, } from 'soapbox/features/ui/util/async-components'; import { useGroup, useOwnAccount } from 'soapbox/hooks'; +import { useGroupMembershipRequests } from 'soapbox/hooks/api/groups/useGroupMembershipRequests'; import { Group } from 'soapbox/schemas'; import { Tabs } from '../components/ui'; @@ -63,6 +64,7 @@ const GroupPage: React.FC = ({ params, children }) => { const id = params?.id || ''; const { group } = useGroup(id); + const { accounts: pending } = useGroupMembershipRequests(id); const isMember = !!group?.relationship?.member; const isBlocked = group?.relationship?.blocked_by; @@ -78,6 +80,7 @@ const GroupPage: React.FC = ({ params, children }) => { text: intl.formatMessage(messages.members), to: `/groups/${group?.id}/members`, name: '/groups/:id/members', + count: pending.length, }, ];