diff --git a/src/components/CryptoInput/index.tsx b/src/components/CryptoInput/index.tsx index 3f49640..8b93bc3 100644 --- a/src/components/CryptoInput/index.tsx +++ b/src/components/CryptoInput/index.tsx @@ -9,6 +9,7 @@ export const CryptoInput: React.FC = ({ currencyQuote, onChange, onChangeCurrency, + showBalance = true, }) => { const [currency, setCurrency] = React.useState( t.CurrencyTypeEnum.NEAR @@ -33,7 +34,7 @@ export const CryptoInput: React.FC = ({ return ( <> - {maxValue ? ( + {showBalance && maxValue ? ( void maxValue?: string currencyQuote?: number + showBalance?: boolean } export enum CurrencyTypeEnum { diff --git a/src/components/CryptoInput/utils.ts b/src/components/CryptoInput/utils.ts deleted file mode 100644 index c85b624..0000000 --- a/src/components/CryptoInput/utils.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const fetchFiatValue = async (): Promise => { - const response = await fetch(`https://near-contract-helper.onrender.com/fiat`) - const data = await response.json() - return Number(data?.near.usd) -} diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 2d0c799..8273a8e 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -87,6 +87,7 @@ export const Navbar: React.FC = () => { weight="normal" size="medium" reverse={false} + onClick={() => router.push('/swap')} /> = ({ + value, + maxValue, + swapQuote, + onChange, + onChangeCurrency, +}) => { + const [currency, setCurrency] = React.useState( + t.CurrencyTypeEnum.NEAR + ) + const handleChangeCurrency = () => { + const newCurrency = + currency === t.CurrencyTypeEnum.NEAR + ? t.CurrencyTypeEnum.QUID + : t.CurrencyTypeEnum.NEAR + setCurrency(newCurrency) + onChangeCurrency && onChangeCurrency(newCurrency) + } + + return ( + + {maxValue ? ( + + Pay: + + + balance: {Number(maxValue || 0).toFixed(3)} + +