Skip to content

Commit

Permalink
Hide view button if no delegates for AVC exist
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgoth committed Aug 9, 2023
1 parent 0291161 commit 16311ef
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions modules/avcs/components/AvcOverviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ export const AvcOverviewCard = memo(function AvcOverviewCard({ avc }: { avc: Avc
}}
>
<AvcAvatarName avc={avc} />
<InternalLink href="/delegates" queryParams={{ avc: avc.name }} title="View delegates">
<Button variant="primaryLarge" data-testid="button-avc-view-delegates">
View Delegates
</Button>
</InternalLink>
{avc.delegateCount > 0 ? (
<InternalLink href="/delegates" queryParams={{ avc: avc.name }} title="View delegates">
<Button variant="primaryLarge" data-testid="button-avc-view-delegates">
View Delegates
</Button>
</InternalLink>
) : (
<></>
)}
</Flex>

<Text variant="secondary" sx={{ whiteSpace: 'pre-line' }}>
Expand Down

0 comments on commit 16311ef

Please sign in to comment.