From 42513202d08d8dc1ac2e4b0a294540410c2a9b40 Mon Sep 17 00:00:00 2001 From: MartinGbz Date: Wed, 8 Jan 2025 10:54:31 +0100 Subject: [PATCH] fix: aprs check inside the IncentivesButton component --- src/components/incentives/IncentivesButton.tsx | 2 +- src/components/incentives/IncentivesCard.tsx | 9 ++++++--- .../transactions/FlowCommons/TxModalDetails.tsx | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/incentives/IncentivesButton.tsx b/src/components/incentives/IncentivesButton.tsx index 71c163ef62..3acbb47498 100644 --- a/src/components/incentives/IncentivesButton.tsx +++ b/src/components/incentives/IncentivesButton.tsx @@ -95,7 +95,7 @@ export const ZkIgniteIncentivesButton = (params: { export const IncentivesButton = ({ incentives, symbol, displayBlank }: IncentivesButtonProps) => { const [open, setOpen] = useState(false); - if (!(incentives && incentives.length > 0)) { + if (!(incentives && incentives.filter((i) => i.incentiveAPR !== '0').length > 0)) { if (displayBlank) { return ; } else { diff --git a/src/components/incentives/IncentivesCard.tsx b/src/components/incentives/IncentivesCard.tsx index 3e388881ab..226602eb03 100644 --- a/src/components/incentives/IncentivesCard.tsx +++ b/src/components/incentives/IncentivesCard.tsx @@ -38,8 +38,10 @@ interface IncentivesBoxProps { } export const hasIncentivesCheck = (incentives: IncentivesBoxProps) => { - const lmIncentivesCheck = - incentives.incentives && incentives.incentives.filter((i) => i.incentiveAPR !== '0').length > 0; + const lmIncentives = IncentivesButton({ + symbol: incentives.symbol, + incentives: incentives.incentives, + }); const meritIncentives = MeritIncentivesButton({ symbol: incentives.symbol, @@ -52,7 +54,8 @@ export const hasIncentivesCheck = (incentives: IncentivesBoxProps) => { rewardedAsset: incentives.address, protocolAction: incentives.protocolAction, }); - if (lmIncentivesCheck || meritIncentives || zkIgniteIncentives) { + + if (lmIncentives || meritIncentives || zkIgniteIncentives) { return true; } else { return false; diff --git a/src/components/transactions/FlowCommons/TxModalDetails.tsx b/src/components/transactions/FlowCommons/TxModalDetails.tsx index a0adfdbe84..38bed9a90e 100644 --- a/src/components/transactions/FlowCommons/TxModalDetails.tsx +++ b/src/components/transactions/FlowCommons/TxModalDetails.tsx @@ -300,6 +300,7 @@ export const DetailsIncentivesLine = ({ market={market} address={address} protocolAction={protocolAction} + isInModal={true} /> ) : (