assembly/components/sidebar/context/overview/SidebarOverviewBalance.vue

30 lines
891 B
Vue
Raw Normal View History

2021-08-01 18:29:41 +00:00
<template>
2021-08-04 19:17:26 +00:00
<div class="flex flex-col items-center text-primary-black flex-shrink-0 w-full px-8 mb-2 text-center sm:mb-10">
<h3 class="flex items-center font-medium leading-none">Balance</h3>
<div class="mt-2 font-semibold text-32">{{ formatUsd(balanceTotal) }}</div>
2021-08-01 18:29:41 +00:00
</div>
</template>
<script>
import { defineComponent, onMounted } from '@nuxtjs/composition-api'
import SVGChevronUp from '@/assets/img/icons/chevron-up.svg'
import { useFormatting } from '~/composables/useFormatting'
import { useBalances } from '~/composables/useBalances'
export default defineComponent({
components: {
SVGChevronUp,
},
setup() {
const { formatUsd } = useFormatting()
const { balanceTotal, fetchBalances, balances, prices } = useBalances()
onMounted(() => {
fetchBalances(true)
})
return { formatUsd, balanceTotal, balances, prices }
},
})
</script>