Skip to content

Commit fd11591

Browse files
committed
fix: tooltip for temp widget
1 parent ab80b8c commit fd11591

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

components/widgets/TemporaryWidget.vue

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<script setup>
2+
/** UI */
3+
import Tooltip from "@/components/ui/Tooltip.vue"
4+
25
/** API */
36
import { fetchSummary } from "@/services/api/stats"
47
import { fetchAddressesCount } from "@/services/api/address"
@@ -37,9 +40,25 @@ onMounted(async () => {
3740
<Text size="13" weight="600" height="110" color="secondary">Validators</Text>
3841
</Flex>
3942

40-
<Flex gap="2" :class="$style.bars">
41-
<div v-for="item in 10" :class="[$style.bar, (100 * 100) / totalValidators > item * 10 && $style.active]" />
42-
</Flex>
43+
<Tooltip position="start">
44+
<Flex gap="2" :class="$style.bars">
45+
<div v-for="item in 10" :class="[$style.bar, (100 * 100) / totalValidators > item * 10 && $style.active]" />
46+
</Flex>
47+
48+
<template #content>
49+
<Flex direction="column" gap="4">
50+
<Flex justify="between" align="center" gap="40">
51+
<Text color="secondary">Active / Total</Text>
52+
<Text color="primary"> 100 / {{ totalValidators }} </Text>
53+
</Flex>
54+
55+
<Flex justify="between" align="center" gap="8">
56+
<Text color="secondary">Percentage</Text>
57+
<Text color="primary">{{ ((100 * 100) / totalValidators).toFixed(2) }}%</Text>
58+
</Flex>
59+
</Flex>
60+
</template>
61+
</Tooltip>
4362

4463
<Flex align="center" justify="between">
4564
<Text size="12" weight="600" color="tertiary"> Active Validators </Text>

0 commit comments

Comments
 (0)