Skip to content

Commit

Permalink
feat: smart balance on account tab. Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
RealGoodProgrammer committed Jul 9, 2024
1 parent 7ddec1f commit 0a447cd
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/components/WalletCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@
{{ $t('home.balance') }}
</v-list-item-title>
<v-list-item-subtitle :class="classes.walletCardSubtitle">
{{ xs ? calculatedBalance : calculatedFullBalance }} {{ crypto }}
<span v-if="$store.state.rate.isLoaded" class="a-text-regular"
>~{{ rate }} {{ currentCurrency }}</span
>
<p>
{{ xs ? calculatedBalance : calculatedFullBalance }} {{ crypto }}
<span v-if="$store.state.rate.isLoaded" class="a-text-regular">
~{{ rate }} {{ currentCurrency }}
</span>
<v-tooltip
v-if="xs && calculatedFullBalance.toString().length > SIGNIFICANT_DIGITS"
activator="parent"
location="top left"
>
{{ calculatedFullBalance }}
</v-tooltip>
</p>
</v-list-item-subtitle>

<template #append>
Expand Down Expand Up @@ -56,6 +65,7 @@ import smartNumber from '@/lib/smartNumber'
import currencyAmount from '@/filters/currencyAmount'
import { useStore } from 'vuex'
const SIGNIFICANT_DIGITS = 7
const className = 'wallet-card'
const classes = {
Expand Down Expand Up @@ -122,6 +132,7 @@ export default defineComponent({
})
return {
SIGNIFICANT_DIGITS,
classes,
calculatedBalance,
calculatedFullBalance,
Expand Down

0 comments on commit 0a447cd

Please sign in to comment.