+
+
+
+
+ {!props.isCustomRatio && (
+
+ )}
+
+
-
-
{`${props.primaryAsset.symbol}-${props.secondaryAsset.symbol} Position Value`}
-
+
+ {disableInput ? (
+
+
+
+
+
+
+
+ You currently have little to none of one asset. Toggle custom ratio to supply your
+ assets asymmetrically.
+
+
+
+
+ ) : (
+
+ )}
+
+
+ Custom ratio
+
+
+
+ {`${props.primaryAsset.symbol}-${props.secondaryAsset.symbol} Deposit Value`}
+
+
+
-
)
}
diff --git a/src/components/Modals/vault/VaultDepositSubTitle.tsx b/src/components/Modals/vault/VaultDepositSubTitle.tsx
new file mode 100644
index 00000000..d0bda4b9
--- /dev/null
+++ b/src/components/Modals/vault/VaultDepositSubTitle.tsx
@@ -0,0 +1,49 @@
+import BigNumber from 'bignumber.js'
+
+import DisplayCurrency from 'components/DisplayCurrency'
+import usePrice from 'hooks/usePrice'
+import useStore from 'store'
+import { formatAmountWithSymbol } from 'utils/formatters'
+
+interface Props {
+ primaryAmount: BigNumber
+ secondaryAmount: BigNumber
+ primaryAsset: Asset
+ secondaryAsset: Asset
+}
+
+export default function VaultDepositSubTitle(props: Props) {
+ const baseCurrency = useStore((s) => s.baseCurrency)
+ const primaryPrice = usePrice(props.primaryAsset.denom)
+ const secondaryPrice = usePrice(props.secondaryAsset.denom)
+ const primaryText = formatAmountWithSymbol({
+ denom: props.primaryAsset.denom,
+ amount: props.primaryAmount.toString(),
+ })
+ const secondaryText = formatAmountWithSymbol({
+ denom: props.secondaryAsset.denom,
+ amount: props.secondaryAmount.toString(),
+ })
+
+ const positionValue = props.primaryAmount
+ .times(primaryPrice)
+ .plus(props.secondaryAmount.times(secondaryPrice))
+ .toNumber()
+
+ const showPrimaryText = !props.primaryAmount.isZero()
+ const showSecondaryText = !props.secondaryAmount.isZero()
+
+ return (
+ <>
+ {showPrimaryText && primaryText}
+ {showPrimaryText && showSecondaryText && ' + '}
+ {showSecondaryText && secondaryText}
+ {(showPrimaryText || showSecondaryText) && (
+ <>
+ {` = `}
+
+ >
+ )}
+ >
+ )
+}
diff --git a/src/components/Modals/vault/VaultModalContent.tsx b/src/components/Modals/vault/VaultModalContent.tsx
index 45108289..e926e2b8 100644
--- a/src/components/Modals/vault/VaultModalContent.tsx
+++ b/src/components/Modals/vault/VaultModalContent.tsx
@@ -1,12 +1,13 @@
import BigNumber from 'bignumber.js'
-import { useState } from 'react'
+import { useCallback, useState } from 'react'
import Accordion from 'components/Accordion'
import AccountSummary from 'components/Account/AccountSummary'
+import VaultBorrowings from 'components/Modals/vault/VaultBorrowings'
+import VaultDeposit from 'components/Modals/vault/VaultDeposit'
+import VaultDepositSubTitle from 'components/Modals/vault/VaultDepositSubTitle'
import useIsOpenArray from 'hooks/useIsOpenArray'
-
-import VaultDeposit from './VaultDeposit'
-import VaultBorrowings from './VaultBorrowings'
+import { BN } from 'utils/helpers'
interface Props {
vault: Vault
@@ -17,7 +18,23 @@ interface Props {
export default function VaultModalContent(props: Props) {
const [isOpen, toggleOpen] = useIsOpenArray(2, false)
- const [deposits, setDeposits] = useState