mirror of
https://github.com/Instadapp/assembly.git
synced 2024-07-29 22:37:06 +00:00
closes #2
This commit is contained in:
parent
a079591263
commit
063f454713
|
@ -27,17 +27,6 @@
|
||||||
placeholder="Amount to borrow"
|
placeholder="Amount to borrow"
|
||||||
:error="errors.amount.message"
|
:error="errors.amount.message"
|
||||||
>
|
>
|
||||||
<template v-if="!isMaxAmount" #suffix>
|
|
||||||
<div class="absolute mt-2 top-0 right-0 mr-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="text-primary-blue-dark font-semibold text-sm hover:text-primary-blue-hover"
|
|
||||||
@click="toggle"
|
|
||||||
>
|
|
||||||
Max
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</input-numeric>
|
</input-numeric>
|
||||||
|
|
||||||
<SidebarContextHeading class="mt-5">
|
<SidebarContextHeading class="mt-5">
|
||||||
|
@ -150,12 +139,6 @@ export default defineComponent({
|
||||||
|
|
||||||
const address = computed(() => token.value?.address)
|
const address = computed(() => token.value?.address)
|
||||||
|
|
||||||
const factor = computed(
|
|
||||||
() => displayPositions.value?.find((position) => rootTokenKey.value === position.key)?.factor
|
|
||||||
)
|
|
||||||
|
|
||||||
const { toggle, isMaxAmount } = useMaxAmountActive(amount, balance)
|
|
||||||
|
|
||||||
const { validateAmount, validateLiquidation, validateLiquidity, validateIsLoggedIn } = useValidators()
|
const { validateAmount, validateLiquidation, validateLiquidity, validateIsLoggedIn } = useValidators()
|
||||||
const errors = computed(() => {
|
const errors = computed(() => {
|
||||||
const hasAmountValue = !isZero(amount.value)
|
const hasAmountValue = !isZero(amount.value)
|
||||||
|
@ -218,8 +201,6 @@ export default defineComponent({
|
||||||
formatNumber,
|
formatNumber,
|
||||||
formatUsdMax,
|
formatUsdMax,
|
||||||
formatUsd,
|
formatUsd,
|
||||||
toggle,
|
|
||||||
isMaxAmount,
|
|
||||||
maxLiquidation,
|
maxLiquidation,
|
||||||
liquidationPrice,
|
liquidationPrice,
|
||||||
liquidationMaxPrice,
|
liquidationMaxPrice,
|
||||||
|
|
|
@ -19,17 +19,6 @@
|
||||||
placeholder="Amount to borrow"
|
placeholder="Amount to borrow"
|
||||||
:error="errors.amount.message"
|
:error="errors.amount.message"
|
||||||
>
|
>
|
||||||
<template v-if="!isMaxAmount" #suffix>
|
|
||||||
<div class="absolute mt-2 top-0 right-0 mr-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="text-primary-blue-dark font-semibold text-sm hover:text-primary-blue-hover"
|
|
||||||
@click="toggle"
|
|
||||||
>
|
|
||||||
Max
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</input-numeric>
|
</input-numeric>
|
||||||
|
|
||||||
<SidebarContextHeading class="mt-5">
|
<SidebarContextHeading class="mt-5">
|
||||||
|
@ -70,14 +59,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { computed, defineComponent, ref } from '@nuxtjs/composition-api'
|
import { computed, defineComponent, ref } from '@nuxtjs/composition-api'
|
||||||
import InputNumeric from '~/components/common/input/InputNumeric.vue'
|
import InputNumeric from '~/components/common/input/InputNumeric.vue'
|
||||||
import { useBalances } from '~/composables/useBalances'
|
|
||||||
import { useBigNumber } from '~/composables/useBigNumber'
|
import { useBigNumber } from '~/composables/useBigNumber'
|
||||||
import { useFormatting } from '~/composables/useFormatting'
|
import { useFormatting } from '~/composables/useFormatting'
|
||||||
import { useValidators } from '~/composables/useValidators'
|
import { useValidators } from '~/composables/useValidators'
|
||||||
import { useValidation } from '~/composables/useValidation'
|
import { useValidation } from '~/composables/useValidation'
|
||||||
import { useToken } from '~/composables/useToken'
|
import { useToken } from '~/composables/useToken'
|
||||||
import { useParsing } from '~/composables/useParsing'
|
import { useParsing } from '~/composables/useParsing'
|
||||||
import { useMaxAmountActive } from '~/composables/useMaxAmountActive'
|
|
||||||
import { useWeb3 } from '~/composables/useWeb3'
|
import { useWeb3 } from '~/composables/useWeb3'
|
||||||
import ToggleButton from '~/components/common/input/ToggleButton.vue'
|
import ToggleButton from '~/components/common/input/ToggleButton.vue'
|
||||||
import { useDSA } from '~/composables/useDSA'
|
import { useDSA } from '~/composables/useDSA'
|
||||||
|
@ -140,10 +127,6 @@ export default defineComponent({
|
||||||
return currentPosition.value?.borrow || '0'
|
return currentPosition.value?.borrow || '0'
|
||||||
})
|
})
|
||||||
|
|
||||||
const address = computed(() => token.value?.address)
|
|
||||||
|
|
||||||
const { toggle, isMaxAmount } = useMaxAmountActive(amount, balance)
|
|
||||||
|
|
||||||
const { validateAmount, validateLiquidation, validateLiquidity, validateIsLoggedIn } = useValidators()
|
const { validateAmount, validateLiquidation, validateLiquidity, validateIsLoggedIn } = useValidators()
|
||||||
const errors = computed(() => {
|
const errors = computed(() => {
|
||||||
const hasAmountValue = !isZero(amount.value)
|
const hasAmountValue = !isZero(amount.value)
|
||||||
|
@ -202,8 +185,6 @@ export default defineComponent({
|
||||||
formatNumber,
|
formatNumber,
|
||||||
formatUsdMax,
|
formatUsdMax,
|
||||||
formatUsd,
|
formatUsd,
|
||||||
toggle,
|
|
||||||
isMaxAmount,
|
|
||||||
liquidationPrice,
|
liquidationPrice,
|
||||||
liquidationMaxPrice,
|
liquidationMaxPrice,
|
||||||
errorMessages,
|
errorMessages,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user