From 02df23bd056fdc616f7a752c7692501be5f08838 Mon Sep 17 00:00:00 2001 From: iliyan90 <74927065+iliyan90@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:27:20 +0300 Subject: [PATCH] ui: Remove donation button from campaign card if completed (#1841) * Remove Donate button from the successful campaign cards on Campaign listing page #1778 * Remove disabled option and yarn format --- .../campaigns/CampaignCard/CampaignCard.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/client/campaigns/CampaignCard/CampaignCard.tsx b/src/components/client/campaigns/CampaignCard/CampaignCard.tsx index cf1ab0d60..d5c7b81ef 100644 --- a/src/components/client/campaigns/CampaignCard/CampaignCard.tsx +++ b/src/components/client/campaigns/CampaignCard/CampaignCard.tsx @@ -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> )