Skip to content

Commit

Permalink
ui: Remove donation button from campaign card if completed (podkrepi-…
Browse files Browse the repository at this point in the history
…bg#1841)

* Remove Donate button from the successful campaign cards on Campaign listing page podkrepi-bg#1778

* Remove disabled option and yarn format
  • Loading branch information
iliyan90 authored and gparlakov committed Jun 19, 2024
1 parent d5385a3 commit 02df23b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/client/campaigns/CampaignCard/CampaignCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,14 @@ export default function ActiveCampaignCard({ campaign, index }: Props) {
</StyledContent>
</Link>
<StyledCardActions disableSpacing>
<DonateButton
href={routes.campaigns.oneTimeDonation(slug)}
disabled={campaignState === CampaignState.complete && !allowDonationOnComplete}
variant="contained"
color="secondary">
{t('cta.support')}
</DonateButton>
{(campaignState === CampaignState.complete && !allowDonationOnComplete) || (
<DonateButton
href={routes.campaigns.oneTimeDonation(slug)}
variant="contained"
color="secondary">
{t('cta.support')}
</DonateButton>
)}
</StyledCardActions>
</Root>
)
Expand Down

0 comments on commit 02df23b

Please sign in to comment.