From 235015763ffe5373aebeeb4e8410110091d137c0 Mon Sep 17 00:00:00 2001 From: vidvidvid Date: Fri, 22 Nov 2024 18:29:46 +0100 Subject: [PATCH] reward icons --- .../ui/app/_components/markets/APRCell.tsx | 47 +++++++++++-------- .../app/_components/markets/RewardsIcon.tsx | 45 ++++++++++++++++++ 2 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 packages/ui/app/_components/markets/RewardsIcon.tsx diff --git a/packages/ui/app/_components/markets/APRCell.tsx b/packages/ui/app/_components/markets/APRCell.tsx index cbed4286e..05ff24a67 100644 --- a/packages/ui/app/_components/markets/APRCell.tsx +++ b/packages/ui/app/_components/markets/APRCell.tsx @@ -16,6 +16,7 @@ import { multipliers } from '@ui/utils/multipliers'; import type { Address } from 'viem'; import type { FlywheelReward } from '@ionicprotocol/types'; +import { RewardIcons } from './RewardsIcon'; const FlyWheelRewards = dynamic(() => import('./FlyWheelRewards'), { ssr: false @@ -101,6 +102,24 @@ export default function APRCell({ ); + const getRewardIcons = () => { + const icons: string[] = []; + + if (showOPRewards) icons.push('op'); + if (config?.ionic) icons.push('ionic'); + if (config?.turtle) icons.push('turtle'); + if (config?.etherfi) icons.push('etherfi'); + if (config?.kelp) icons.push('kelp'); + if (config?.eigenlayer) icons.push('eigen'); + if (config?.spice) icons.push('spice'); + if (type === 'supply') { + if (config?.anzen) icons.push('anzen'); + if (config?.nektar) icons.push('nektar'); + } + + return icons; + }; + return ( @@ -109,7 +128,7 @@ export default function APRCell({
{showRewardsBadge && ( - - {showOPRewards ? ( -
- +{' '} - OP{' '} - REWARDS -
- ) : ( - '+ REWARDS' - )} -
+ + Rewards + +
)} {config?.turtle && !isMainModeMarket && ( { + return ( +
+ {rewards.map((reward, index) => ( +
+
+ {reward} +
+
+ ))} +
+ ); +};