diff --git a/package.json b/package.json index 1b22ae2b..f0fced92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mars-v2-frontend", - "version": "2.2.1", + "version": "2.2.2", "private": true, "scripts": { "build": "yarn validate-env && next build", diff --git a/src/components/Modals/AssetAmountSelectActionModal.tsx b/src/components/Modals/AssetAmountSelectActionModal.tsx index a8f1f2c2..dfa41d9d 100644 --- a/src/components/Modals/AssetAmountSelectActionModal.tsx +++ b/src/components/Modals/AssetAmountSelectActionModal.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react' import Modal from 'components/Modals/Modal' -import CurrentAccountSummary from 'components/account/CurrentAccountSummary' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' import Button from 'components/common/Button' import Card from 'components/common/Card' import Divider from 'components/common/Divider' @@ -10,6 +10,7 @@ import Text from 'components/common/Text' import TokenInputWithSlider from 'components/common/TokenInput/TokenInputWithSlider' import AssetImage from 'components/common/assets/AssetImage' import { BN_ZERO } from 'constants/math' +import useCurrentAccount from 'hooks/accounts/useCurrentAccount' import { BNCoin } from 'types/classes/BNCoin' import { byDenom } from 'utils/array' import { BN } from 'utils/helpers' @@ -38,7 +39,7 @@ export default function AssetAmountSelectActionModal(props: Props) { } = props const [amount, setAmount] = useState(BN_ZERO) const maxAmount = BN(coinBalances.find(byDenom(asset.denom))?.amount ?? 0) - + const account = useCurrentAccount() const handleAmountChange = useCallback( (value: BigNumber) => { setAmount(value) @@ -51,6 +52,7 @@ export default function AssetAmountSelectActionModal(props: Props) { onAction(amount, amount.isEqualTo(maxAmount)) }, [amount, maxAmount, onAction]) + if (!account) return return ( } /> - + ) diff --git a/src/components/Modals/BorrowModal.tsx b/src/components/Modals/BorrowModal.tsx index a526c0f2..1f943315 100644 --- a/src/components/Modals/BorrowModal.tsx +++ b/src/components/Modals/BorrowModal.tsx @@ -29,6 +29,7 @@ import { byDenom } from 'utils/array' import { formatPercent } from 'utils/formatters' import { BN } from 'utils/helpers' import { getDebtAmountWithInterest } from 'utils/tokens' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' interface Props { account: Account @@ -347,7 +348,7 @@ function BorrowModal(props: Props) { rightIcon={} /> - + ) diff --git a/src/components/Modals/HLS/Deposit/SubTitles.tsx b/src/components/Modals/HLS/Deposit/SubTitles.tsx index 987f2bac..550d0fae 100644 --- a/src/components/Modals/HLS/Deposit/SubTitles.tsx +++ b/src/components/Modals/HLS/Deposit/SubTitles.tsx @@ -1,5 +1,4 @@ import classNames from 'classnames' -import React from 'react' import DisplayCurrency from 'components/common/DisplayCurrency' import { ExclamationMarkTriangle } from 'components/common/Icons' @@ -40,8 +39,10 @@ export function CollateralSubTitle(props: CollateralSubTitleProps) { if (!props.isOpen && props.amount.isZero()) { return (
- - +
+ +
+ You have not provided any collateral.
@@ -111,8 +112,10 @@ export function SelectAccountSubTitle(props: SelectAccountSubTitleProps) { if (!props.selectedAccountId && props.isSummaryOpen) { return (
- - +
+ +
+ You need to {props.type} an account
diff --git a/src/components/Modals/ModalContentWithSummary.tsx b/src/components/Modals/ModalContentWithSummary.tsx index c06dfbda..e1df5cbd 100644 --- a/src/components/Modals/ModalContentWithSummary.tsx +++ b/src/components/Modals/ModalContentWithSummary.tsx @@ -1,10 +1,10 @@ import classNames from 'classnames' import React from 'react' -import AccountSummary from 'components/account/AccountSummary' import Card from 'components/common/Card' import { CircularProgress } from 'components/common/CircularProgress' import Modal, { ModalProps } from 'components/Modals/Modal' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' interface Props extends ModalProps { isHls?: boolean @@ -46,7 +46,7 @@ export default function ModalContentWithSummary(props: Props) { > {props.subHeader && props.subHeader} {modalContent(props.content, props.isContentCard, props.account)} - {props.account && } + {props.account && } ) } diff --git a/src/components/Modals/Vault/VaultModalContent.tsx b/src/components/Modals/Vault/VaultModalContent.tsx index 4a11fb10..83a003a5 100644 --- a/src/components/Modals/Vault/VaultModalContent.tsx +++ b/src/components/Modals/Vault/VaultModalContent.tsx @@ -1,11 +1,11 @@ import { useCallback, useMemo, useState } from 'react' -import Accordion from 'components/common/Accordion' -import AccountSummary from 'components/account/AccountSummary' import VaultBorrowings from 'components/Modals/Vault/VaultBorrowings' import VaultBorrowingsSubTitle from 'components/Modals/Vault/VaultBorrowingsSubTitle' import VaultDeposit from 'components/Modals/Vault/VaultDeposits' import VaultDepositSubTitle from 'components/Modals/Vault/VaultDepositsSubTitle' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' +import Accordion from 'components/common/Accordion' import Text from 'components/common/Text' import { BN_ZERO } from 'constants/math' import useAllAssets from 'hooks/assets/useAllAssets' @@ -177,8 +177,7 @@ export default function VaultModalContent(props: Props) { }, ]} /> - - + ) } diff --git a/src/components/Wallet/WalletConnectButton.tsx b/src/components/Wallet/WalletConnectButton.tsx index 54c71755..08bb00ef 100644 --- a/src/components/Wallet/WalletConnectButton.tsx +++ b/src/components/Wallet/WalletConnectButton.tsx @@ -28,7 +28,7 @@ export default function WalletConnectButton(props: Props) { return (