From 230179d46b75fc0cd09ef296b55e87dc728032d3 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 8 Aug 2023 11:02:13 -0500 Subject: [PATCH] fix: stable rates on market page (#1728) --- src/modules/markets/MarketAssetsListItem.tsx | 8 +++++++- src/modules/markets/MarketAssetsListMobileItem.tsx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/markets/MarketAssetsListItem.tsx b/src/modules/markets/MarketAssetsListItem.tsx index 4b8e0bb425..61b0be242b 100644 --- a/src/modules/markets/MarketAssetsListItem.tsx +++ b/src/modules/markets/MarketAssetsListItem.tsx @@ -7,6 +7,7 @@ import { NoData } from 'src/components/primitives/NoData'; import { ReserveSubheader } from 'src/components/ReserveSubheader'; import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext'; import { useRootStore } from 'src/store/root'; +import { CustomMarket } from 'src/ui-config/marketsConfig'; import { IncentivesCard } from '../../components/incentives/IncentivesCard'; import { AMPLToolTip } from '../../components/infoTooltips/AMPLToolTip'; @@ -23,6 +24,11 @@ export const MarketAssetsListItem = ({ ...reserve }: ComputedReserveData) => { const { currentMarket } = useProtocolDataContext(); const trackEvent = useRootStore((store) => store.trackEvent); + let showStableBorrowRate = Number(reserve.totalStableDebtUSD) > 0; + if (currentMarket === CustomMarket.proto_mainnet && reserve.symbol === 'TUSD') { + showStableBorrowRate = false; + } + return ( { 0 ? reserve.stableBorrowAPY : '-1'} + value={showStableBorrowRate ? reserve.stableBorrowAPY : '-1'} incentives={reserve.sIncentivesData || []} symbol={reserve.symbol} variant="main16" diff --git a/src/modules/markets/MarketAssetsListMobileItem.tsx b/src/modules/markets/MarketAssetsListMobileItem.tsx index 1384472b86..7091328ddc 100644 --- a/src/modules/markets/MarketAssetsListMobileItem.tsx +++ b/src/modules/markets/MarketAssetsListMobileItem.tsx @@ -6,6 +6,7 @@ import { NoData } from 'src/components/primitives/NoData'; import { ReserveSubheader } from 'src/components/ReserveSubheader'; import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext'; import { useRootStore } from 'src/store/root'; +import { CustomMarket } from 'src/ui-config/marketsConfig'; import { MARKETS } from 'src/utils/mixPanelEvents'; import { IncentivesCard } from '../../components/incentives/IncentivesCard'; @@ -19,6 +20,11 @@ export const MarketAssetsListMobileItem = ({ ...reserve }: ComputedReserveData) const { currentMarket } = useProtocolDataContext(); const trackEvent = useRootStore((store) => store.trackEvent); + let showStableBorrowRate = Number(reserve.totalStableDebtUSD) > 0; + if (currentMarket === CustomMarket.proto_mainnet && reserve.symbol === 'TUSD') { + showStableBorrowRate = false; + } + return ( 0 ? reserve.stableBorrowAPY : '-1'} + value={showStableBorrowRate ? reserve.stableBorrowAPY : '-1'} incentives={reserve.sIncentivesData || []} symbol={reserve.symbol} variant="secondary14"