From a9e87f67c6ccf03eb9dc3cd655c9e20a788979ce Mon Sep 17 00:00:00 2001 From: piekczyk Date: Tue, 18 Jun 2024 16:45:48 +0200 Subject: [PATCH] Total rays earned portfolio (#3955) --- components/portfolio/PortfolioOverview.tsx | 14 +++++++++++++- components/portfolio/types/domain-types.ts | 1 + public/locales/en/portfolio.json | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/components/portfolio/PortfolioOverview.tsx b/components/portfolio/PortfolioOverview.tsx index 422f54de74..bfd57e9db5 100644 --- a/components/portfolio/PortfolioOverview.tsx +++ b/components/portfolio/PortfolioOverview.tsx @@ -4,7 +4,7 @@ import { PortfolioOverviewItem } from 'components/portfolio/PortfolioOverviewIte import { Tag } from 'components/Tag' import { WithArrow } from 'components/WithArrow' import type { PortfolioPosition } from 'handlers/portfolio/types' -import { getLocalAppConfig } from 'helpers/config' +import { getLocalAppConfig, useAppConfig } from 'helpers/config' import { formatCryptoBalance } from 'helpers/formatters/format' import { getGradientColor, summerBrandGradient } from 'helpers/getGradientColor' import { isTouchDevice } from 'helpers/isTouchDevice' @@ -27,7 +27,9 @@ export const PortfolioOverview = ({ }) => { const { t: tPortfolio } = useTranslation('portfolio') const isMobile = useOnMobile() && isTouchDevice + const { Rays: isRaysEnabled } = useAppConfig('features') + const totalRays = portfolioWalletData.totalRaysEarned const totalValue = overviewData.allAssetsUsdValue + portfolioWalletData.totalAssetsUsdValue const availableToMigrateUsdValue = migrationPositions == null @@ -59,6 +61,16 @@ export const PortfolioOverview = ({ columnGap: '24px', }} > + {isRaysEnabled && totalRays && ( + + {formatCryptoBalance(new BigNumber(totalRays)).split('.')[0]} + + } + /> + )}