symbol rework; fee % switching; symbol search improvements

This commit is contained in:
tim
2024-10-11 00:26:29 -04:00
parent 6d19adb130
commit 5b23864c2e
11 changed files with 233 additions and 178 deletions

View File

@@ -3,16 +3,16 @@
<td>
<v-avatar v-if="imageSrc" :image="imageSrc" size="x-small"/>
</td>
<td class="d-none d-sm-table-cell">{{ token.n || '' }}</td>
<td class="d-none d-sm-table-cell">{{ token?.n || '' }}</td>
<td class="text-right">{{ fixed }}</td>
<td class="text-left">{{ token.s }}</td>
<td class="text-left">{{ token?.s }}</td>
<!-- todo price and value columns -->
<td>
<v-menu>
<template v-slot:activator="{ props }">
<v-btn variant="plain" v-bind="props" icon="mdi-dots-vertical"/>
</template>
<v-list>
<v-list v-if="token">
<v-list-subheader :title="token.s"/>
<v-list-item title="Withdraw" key="withdraw" value="withdraw" prepend-icon="mdi-arrow-down-bold"
@click="()=>onWithdraw(token.a)"/>
@@ -26,16 +26,17 @@
import {useStore} from "@/store/store";
import {getToken} from "@/blockchain/token.js";
import {FixedNumber} from "ethers";
import {computed, ref} from "vue";
import {computed} from "vue";
const s = useStore()
const props = defineProps(['chainId', 'addr', 'amount', 'onWithdraw'])
const token = await getToken(props.chainId, props.addr)
const fixed = computed(() => FixedNumber.fromValue(props.amount, token.d, {
console.log('TokenRow token is', token)
const fixed = computed(() => token ? FixedNumber.fromValue(props.amount, token.d, {
width: 256,
decimals: token.d
}))
const imageSrc = computed(() => token.image)
}) : null)
const imageSrc = computed(() => token ? token.image : null)
</script>
<style scoped lang="scss">