assembly/components/sidebar/context/aaveV2/SidebarAaveV2Supply.vue

57 lines
1.5 KiB
Vue
Raw Normal View History

2021-07-24 23:40:30 +00:00
<template>
<SidebarContextRootContainer>
2021-07-26 18:33:52 +00:00
<template #title>Supply {{ symbol }}</template>
2021-07-24 23:40:30 +00:00
2021-07-26 18:33:52 +00:00
<SidebarSectionValueWithIcon class="mt-2" label="Token Balance">
<template #icon
><IconCurrency :currency="rootTokenKey" class="w-20 h-20" noHeight
/></template>
<template #value>{{ balance }} {{ symbol }}</template>
2021-07-24 23:40:30 +00:00
</SidebarSectionValueWithIcon>
2021-07-26 18:33:52 +00:00
<div class="bg-background mt-6 p-8">
<input-numeric v-model="amount" placeholder="Amount to supply" />
2021-07-24 23:40:30 +00:00
</div>
</SidebarContextRootContainer>
</template>
<script>
2021-07-26 18:33:52 +00:00
import { computed, defineComponent, ref } from '@nuxtjs/composition-api'
import InputNumeric from '~/components/common/input/InputNumeric.vue'
2021-07-24 23:40:30 +00:00
import { useAaveV2Position } from '~/composables/useAaveV2Position'
import { useFormatting } from '~/composables/useFormatting'
2021-07-26 18:33:52 +00:00
import { useToken } from '~/composables/useToken'
2021-07-24 23:40:30 +00:00
export default defineComponent({
2021-07-26 18:33:52 +00:00
components: { InputNumeric },
2021-07-24 23:40:30 +00:00
props: {
tokenKey: { type: String, required: true },
},
setup(props) {
2021-07-26 18:33:52 +00:00
const { status, displayPositions } = useAaveV2Position()
// const { formatUsd, formatUsdMax, formatNumber, formatDecimal } = useFormatting()
const amount = ref('')
2021-07-24 23:40:30 +00:00
2021-07-26 18:33:52 +00:00
const rootTokenKey = computed(() => 'eth')
const { getTokenByKey } = useToken()
const token = computed(() => getTokenByKey(props.tokenKey))
const symbol = computed(() => token.value?.symbol)
const balance = computed(() => "0")
2021-07-24 23:40:30 +00:00
return {
2021-07-26 18:33:52 +00:00
amount,
2021-07-24 23:40:30 +00:00
status,
2021-07-26 18:33:52 +00:00
rootTokenKey,
token,
symbol,
balance,
2021-07-24 23:40:30 +00:00
}
},
})
</script>