Skip to content

Commit

Permalink
fix: display issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGbz committed Jan 7, 2025
1 parent 00d439b commit 054cfe1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
42 changes: 23 additions & 19 deletions src/components/transactions/FlowCommons/TxModalDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,15 @@ export const DetailsIncentivesLine = ({
protocolAction,
});

if (!hasIncentives) return null;

const hasFutureIncentives = hasIncentivesCheck({
symbol: futureSymbol || '',
incentives: futureIncentives,
market,
protocolAction,
});

if (!hasIncentives && !hasFutureIncentives) return null;

return (
<Row caption={<Trans>Rewards APR</Trans>} captionVariant="description" mb={4} minHeight={24}>
<Box
Expand All @@ -293,27 +293,31 @@ export const DetailsIncentivesLine = ({
<Skeleton variant="rectangular" height={20} width={100} sx={{ borderRadius: '4px' }} />
) : (
<>
<IncentivesBox
symbol={symbol}
incentives={incentives || []}
market={market}
address={address}
protocolAction={protocolAction}
/>
{hasIncentives ? (
<IncentivesBox
symbol={symbol}
incentives={incentives || []}
market={market}
address={address}
protocolAction={protocolAction}
/>
) : (
<Typography variant="secondary14">
<Trans>None</Trans>
</Typography>
)}
{futureSymbol && (
<>
{ArrowRightIcon}
{hasFutureIncentives ? (
<>
<IncentivesBox
symbol={futureSymbol || ''}
incentives={futureIncentives || []}
market={market}
address={futureAddress}
protocolAction={protocolAction}
isInModal={true}
/>
</>
<IncentivesBox
symbol={futureSymbol || ''}
incentives={futureIncentives || []}
market={market}
address={futureAddress}
protocolAction={protocolAction}
isInModal={true}
/>
) : (
<Typography variant="secondary14">
<Trans>None</Trans>
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ msgstr "Restaking {symbol}"
msgid "Withdrawing {symbol}"
msgstr "Withdrawing {symbol}"

#: src/components/transactions/FlowCommons/TxModalDetails.tsx
#: src/components/transactions/FlowCommons/TxModalDetails.tsx
#: src/modules/governance/RepresentativesInfoPanel.tsx
msgid "None"
Expand Down

0 comments on commit 054cfe1

Please sign in to comment.