From 84277736ec60af758ef4ff678a97cdc54f052a6b Mon Sep 17 00:00:00 2001 From: saml33 Date: Tue, 24 Jan 2023 13:09:14 +1100 Subject: [PATCH] add to other amoutwithvalue components --- components/BorrowForm.tsx | 45 +++++++++-------------------- components/DepositForm.tsx | 19 ++++-------- components/RepayForm.tsx | 19 ++++-------- components/WithdrawForm.tsx | 19 ++++-------- components/shared/BalancesTable.tsx | 26 ++++------------- components/stats/TokenStats.tsx | 12 +++----- 6 files changed, 39 insertions(+), 101 deletions(-) diff --git a/components/BorrowForm.tsx b/components/BorrowForm.tsx index b8a37a9a..ee0c7fe3 100644 --- a/components/BorrowForm.tsx +++ b/components/BorrowForm.tsx @@ -21,11 +21,7 @@ import { INPUT_TOKEN_DEFAULT, } from './../utils/constants' import { notify } from './../utils/notifications' -import { - floorToDecimal, - formatDecimal, - formatFixedDecimals, -} from './../utils/numbers' +import { floorToDecimal, formatDecimal } from './../utils/numbers' import ActionTokenList from './account/ActionTokenList' import ButtonGroup from './forms/ButtonGroup' import Label from './forms/Label' @@ -332,46 +328,33 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) {

{t('withdraw-amount')}

{isBorrow ? ( ) : inputAmount ? ( ) : ( - + )}

{t('borrow-amount')}

{isBorrow ? ( ) : ( - + )}
diff --git a/components/DepositForm.tsx b/components/DepositForm.tsx index 54c34963..1c44290f 100644 --- a/components/DepositForm.tsx +++ b/components/DepositForm.tsx @@ -19,11 +19,7 @@ import { INPUT_TOKEN_DEFAULT, } from './../utils/constants' import { notify } from './../utils/notifications' -import { - floorToDecimal, - formatDecimal, - formatFixedDecimals, -} from './../utils/numbers' +import { floorToDecimal, formatFixedDecimals } from './../utils/numbers' import { TokenAccount } from './../utils/tokens' import ActionTokenList from './account/ActionTokenList' import ButtonGroup from './forms/ButtonGroup' @@ -338,17 +334,12 @@ function DepositForm({ onSuccess, token }: DepositFormProps) {

{t('deposit-amount')}

{inputAmount ? ( ) : ( - + )}
{/*
diff --git a/components/RepayForm.tsx b/components/RepayForm.tsx index ad4a2c03..b0980468 100644 --- a/components/RepayForm.tsx +++ b/components/RepayForm.tsx @@ -13,11 +13,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react' import NumberFormat, { NumberFormatValues } from 'react-number-format' import mangoStore from '@store/mangoStore' import { notify } from './../utils/notifications' -import { - floorToDecimal, - formatDecimal, - formatFixedDecimals, -} from './../utils/numbers' +import { floorToDecimal, formatDecimal } from './../utils/numbers' import ActionTokenList from './account/ActionTokenList' import ButtonGroup from './forms/ButtonGroup' import Label from './forms/Label' @@ -306,17 +302,12 @@ function RepayForm({ onSuccess, token }: RepayFormProps) {

{t('repayment-amount')}

{inputAmount ? ( ) : ( - + )}
diff --git a/components/WithdrawForm.tsx b/components/WithdrawForm.tsx index c7ac3734..e9a29a13 100644 --- a/components/WithdrawForm.tsx +++ b/components/WithdrawForm.tsx @@ -18,11 +18,7 @@ import { INPUT_TOKEN_DEFAULT, } from './../utils/constants' import { notify } from './../utils/notifications' -import { - floorToDecimal, - formatDecimal, - formatFixedDecimals, -} from './../utils/numbers' +import { floorToDecimal } from './../utils/numbers' import ActionTokenList from './account/ActionTokenList' import ButtonGroup from './forms/ButtonGroup' import Label from './forms/Label' @@ -295,17 +291,12 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) {

{t('withdraw-amount')}

{inputAmount ? ( ) : ( - + )}
diff --git a/components/shared/BalancesTable.tsx b/components/shared/BalancesTable.tsx index dcdc7982..394bc6c3 100644 --- a/components/shared/BalancesTable.tsx +++ b/components/shared/BalancesTable.tsx @@ -119,31 +119,17 @@ const BalancesTable = () => { diff --git a/components/stats/TokenStats.tsx b/components/stats/TokenStats.tsx index 72bcab2d..06eadb0e 100644 --- a/components/stats/TokenStats.tsx +++ b/components/stats/TokenStats.tsx @@ -243,12 +243,8 @@ const TokenStats = () => { {t('total-deposits')}

@@ -257,8 +253,8 @@ const TokenStats = () => { {t('total-borrows')}