Skip to content

Commit 738dfb0

Browse files
committed
feat: add rule to avoid displaying apy value beside badge
1 parent faf5691 commit 738dfb0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/components/incentives/IncentivesButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export const MerklIncentivesButton = (params: {
173173
protocolAction?: ProtocolAction;
174174
protocolAPY?: number;
175175
protocolIncentives?: ReserveIncentiveResponse[];
176+
hideValue?: boolean;
176177
}) => {
177178
const [open, setOpen] = useState(false);
178179
const { data: merklIncentives } = useMerklIncentives(params);
@@ -197,7 +198,11 @@ export const MerklIncentivesButton = (params: {
197198
setOpen={setOpen}
198199
open={open}
199200
>
200-
<Content incentives={[incentiveData]} incentivesNetAPR={incentiveAPR} />
201+
<Content
202+
incentives={[incentiveData]}
203+
incentivesNetAPR={incentiveAPR}
204+
hideValue={params.hideValue}
205+
/>
201206
</ContentWithTooltip>
202207
);
203208
};

src/components/incentives/IncentivesCard.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ export const IncentivesCard = ({
111111
const isSghoPage =
112112
typeof router?.asPath === 'string' && router.asPath.toLowerCase().startsWith('/sgho');
113113
const hideMeritValue = symbol === 'GHO' && !isSghoPage;
114+
const isMarketsOrDashboardPage =
115+
typeof router?.pathname === 'string' &&
116+
(router.pathname.startsWith('/dashboard') || router.pathname.startsWith('/markets'));
117+
// Hide GHO Merkl value on dashboard/markets; show only the badge icon.
118+
const hideMerklValue =
119+
symbol === 'GHO' &&
120+
(protocolAction === ProtocolAction.borrow || protocolAction === ProtocolAction.supply) &&
121+
isMarketsOrDashboardPage;
114122

115123
const incentivesContent = (
116124
<>
@@ -136,6 +144,7 @@ export const IncentivesCard = ({
136144
protocolAction={protocolAction}
137145
protocolAPY={protocolAPY}
138146
protocolIncentives={incentives || []}
147+
hideValue={hideMerklValue}
139148
/>
140149
<EthenaIncentivesButton rewardedAsset={address} />
141150
<EtherfiIncentivesButton symbol={symbol} market={market} protocolAction={protocolAction} />

0 commit comments

Comments
 (0)