From 74660e08fb3e2fc1b77df1a15027a092bb808271 Mon Sep 17 00:00:00 2001 From: saml33 Date: Mon, 18 Mar 2024 11:46:52 +1100 Subject: [PATCH] component for interest rates display --- components/TokenList.tsx | 39 +++++------------ components/explore/SpotCards.tsx | 12 +++--- components/explore/SpotTable.tsx | 33 +++++--------- components/shared/TableRatesDisplay.tsx | 34 +++++++++++++++ .../stats/tokens/TokenOverviewTable.tsx | 43 +++++-------------- components/token/ActionPanel.tsx | 19 +++----- utils/numbers.ts | 2 +- 7 files changed, 78 insertions(+), 104 deletions(-) create mode 100644 components/shared/TableRatesDisplay.tsx diff --git a/components/TokenList.tsx b/components/TokenList.tsx index 9f5745d3..bd2d011b 100644 --- a/components/TokenList.tsx +++ b/components/TokenList.tsx @@ -50,6 +50,7 @@ import { floorToDecimal } from 'utils/numbers' import SheenLoader from './shared/SheenLoader' import useAccountInterest from 'hooks/useAccountInterest' import { handleGoToTradePage } from 'utils/markets' +import TableRatesDisplay from './shared/TableRatesDisplay' export const handleOpenCloseBorrowModal = (borrowBank: Bank) => { const group = mangoStore.getState().group @@ -424,25 +425,10 @@ const TokenList = () => {
- -

- - % -

-
- | - -

- - % -

-
+
@@ -601,15 +587,12 @@ const MobileTokenListItem = ({ data }: { data: TableData }) => {

{t('rates')}

-

- - % - - | - - % - -

+
+ +
diff --git a/components/explore/SpotCards.tsx b/components/explore/SpotCards.tsx index 29803fcb..8d3a2012 100644 --- a/components/explore/SpotCards.tsx +++ b/components/explore/SpotCards.tsx @@ -17,6 +17,7 @@ import useThemeWrapper from 'hooks/useThemeWrapper' import TokenReduceOnlyDesc from '@components/shared/TokenReduceOnlyDesc' import CollateralWeightDisplay from '@components/shared/CollateralWeightDisplay' import WatchlistButton from './WatchlistButton' +import TableRatesDisplay from '@components/shared/TableRatesDisplay' const SpotCards = ({ tokens }: { tokens: BankWithMarketData[] }) => { const { t } = useTranslation(['common', 'explore', 'trade']) @@ -144,13 +145,10 @@ const SpotCards = ({ tokens }: { tokens: BankWithMarketData[] }) => {

{t('rates')}

-

- % -

- | -

- % -

+