Skip to content

Commit

Permalink
ui: Remove donation button from campaign card if completed (#1841)
Browse files Browse the repository at this point in the history
* Remove Donate button from the successful campaign cards on Campaign listing page #1778

* Remove disabled option and yarn format
  • Loading branch information
iliyan90 committed Jun 17, 2024
1 parent ae19aeb commit c7aa30f
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 c7aa30f

Please sign in to comment.