From 2f9f01d28e30848de49cd6a0fb80a038e946aec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvaro=20Fari=C3=B1a?= Date: Mon, 1 Feb 2021 13:13:54 -0300 Subject: [PATCH] feat: adds not enough funds atom component --- src/components/atoms/NotEnoughFunds.tsx | 14 ++++++++++++++ .../organisms/storage/staking/DepositModal.tsx | 9 +++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 src/components/atoms/NotEnoughFunds.tsx diff --git a/src/components/atoms/NotEnoughFunds.tsx b/src/components/atoms/NotEnoughFunds.tsx new file mode 100644 index 000000000..b040fa45d --- /dev/null +++ b/src/components/atoms/NotEnoughFunds.tsx @@ -0,0 +1,14 @@ +import Typography from '@material-ui/core/Typography' +import React, { FC } from 'react' + +export type NotEnoughFundsProps = { + currencyDisplayName: string +} + +const NotEnoughFunds: FC = ({ currencyDisplayName }) => ( + + {`You do not have enough ${currencyDisplayName}`} + +) + +export default NotEnoughFunds diff --git a/src/components/organisms/storage/staking/DepositModal.tsx b/src/components/organisms/storage/staking/DepositModal.tsx index c31c522cd..3189877d7 100644 --- a/src/components/organisms/storage/staking/DepositModal.tsx +++ b/src/components/organisms/storage/staking/DepositModal.tsx @@ -12,7 +12,8 @@ import React, { import Big from 'big.js' import { getBalance } from 'contracts/utils/accountBalance' import { convertToWeiString } from 'utils/parsers' -import { SupportedTokenSymbol, SYSTEM_SUPPORTED_SYMBOL } from 'models/Token' +import { SupportedTokenSymbol, SYSTEM_SUPPORTED_SYMBOL, SYSTEM_TOKENS } from 'models/Token' +import NotEnoughFunds from 'components/atoms/NotEnoughFunds' import StakedBalances from './StakedBalances' export interface DepositModalProps { @@ -142,9 +143,9 @@ const DepositModal: FC = ({ { isPositiveAmount && !enoughFunds && ( - - {`You do not have enough ${selectedToken.toUpperCase()}`} - + ) }