Skip to content

Commit f2e3134

Browse files
committed
Pie charts legend links, replace download button
1 parent 70645d2 commit f2e3134

2 files changed

Lines changed: 52 additions & 41 deletions

File tree

components/modules/stats/PieChartCard.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const props = defineProps({
2727
},
2828
})
2929
30+
const router = useRouter()
31+
3032
const resData = ref([])
3133
const total = ref(0)
3234
@@ -37,6 +39,7 @@ const prepareRollupsData = () => {
3739
resData.value.push(
3840
{
3941
name: el.name,
42+
slug: el.slug,
4043
value: props.series.units === 'utia' ? Math.round(el[key], 2) : el[key],
4144
}
4245
)
@@ -201,6 +204,12 @@ const init = () => {
201204
})
202205
}
203206
207+
const handleNavigate = (el) => {
208+
if (el.slug) {
209+
router.push(`/rollup/${el.slug}`)
210+
}
211+
}
212+
204213
onMounted(() => {
205214
init()
206215
})
@@ -222,6 +231,7 @@ watch(
222231
<Flex align="center" justify="between" wide>
223232
<Flex align="center" direction="column" gap="16" wide :class="$style.legend_wrapper">
224233
<Flex v-for="(el, index) in resData"
234+
@click="handleNavigate(el)"
225235
align="center"
226236
justify="between" wide
227237
:style="{ animationDelay: `${index * 0.1}s` }"
@@ -231,6 +241,7 @@ watch(
231241
{
232242
[$style.legend_item]: true,
233243
[$style.fadein]: true,
244+
[$style.clickable]: el.name !== 'Other',
234245
}
235246
]"
236247
>
@@ -300,6 +311,10 @@ watch(
300311
margin-right: 6px;
301312
}
302313
314+
.clickable {
315+
cursor: pointer;
316+
}
317+
303318
.chart_wrapper {
304319
width: 155px;
305320
height: 155px;

pages/blob.vue

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ const handleCopy = (text) => {
226226
<Icon name="blob" size="12" color="secondary" />
227227
Select blob
228228
</Button>
229+
<Button @click="handleDownload" type="secondary" size="mini" wide>
230+
<Icon name="download" size="14" color="secondary" />
231+
</Button>
229232
<Button @click="modalsStore.open('hexSettings')" size="mini" type="secondary">
230233
<Icon name="settings" size="12" color="secondary" />
231234
</Button>
@@ -417,54 +420,47 @@ const handleCopy = (text) => {
417420
</Flex>
418421
</Flex>
419422
420-
<Flex direction="column" gap="16">
423+
<Flex direction="column" gap="8">
424+
<Text size="12" weight="600" color="tertiary"> Commitment </Text>
425+
<Text
426+
size="12"
427+
weight="600"
428+
color="secondary"
429+
selectable
430+
style="text-overflow: ellipsis; overflow: hidden"
431+
>
432+
{{ blob.commitment }}
433+
</Text>
434+
</Flex>
435+
436+
<NuxtLink :to="`/address/${metadata.signer}`" target="_blank">
421437
<Flex direction="column" gap="8">
422-
<Text size="12" weight="600" color="tertiary"> Commitment </Text>
423-
<Text
424-
size="12"
425-
weight="600"
426-
color="secondary"
427-
selectable
428-
style="text-overflow: ellipsis; overflow: hidden"
429-
>
430-
{{ blob.commitment }}
438+
<Text size="12" weight="600" color="tertiary"> Signer </Text>
439+
<Text size="12" weight="600" color="secondary" style="text-overflow: ellipsis; overflow: hidden">
440+
{{ metadata.signer }}
431441
</Text>
432442
</Flex>
443+
</NuxtLink>
433444
434-
<NuxtLink :to="`/address/${metadata.signer}`" target="_blank">
435-
<Flex direction="column" gap="8">
436-
<Text size="12" weight="600" color="tertiary"> Signer </Text>
437-
<Text size="12" weight="600" color="secondary" style="text-overflow: ellipsis; overflow: hidden">
438-
{{ metadata.signer }}
439-
</Text>
440-
</Flex>
441-
</NuxtLink>
442-
443-
<NuxtLink v-if="metadata.rollup" :to="`/rollup/${metadata.rollup.slug}`" target="_blank">
444-
<Flex direction="column" gap="8">
445-
<Text size="12" weight="600" color="tertiary"> Rollup </Text>
445+
<NuxtLink v-if="metadata.rollup" :to="`/rollup/${metadata.rollup.slug}`" target="_blank">
446+
<Flex direction="column" gap="8">
447+
<Text size="12" weight="600" color="tertiary"> Rollup </Text>
446448
447-
<Flex align="center" gap="8">
448-
<Flex align="center" justify="center" :class="$style.avatar_container">
449-
<img :src="metadata.rollup.logo" :class="$style.avatar_image" />
450-
</Flex>
451-
<Text
452-
size="12"
453-
weight="600"
454-
color="secondary"
455-
style="text-overflow: ellipsis; overflow: hidden"
456-
>
457-
{{ metadata.rollup.name }}
458-
</Text>
449+
<Flex align="center" gap="8">
450+
<Flex align="center" justify="center" :class="$style.avatar_container">
451+
<img :src="metadata.rollup.logo" :class="$style.avatar_image" />
459452
</Flex>
453+
<Text
454+
size="12"
455+
weight="600"
456+
color="secondary"
457+
style="text-overflow: ellipsis; overflow: hidden"
458+
>
459+
{{ metadata.rollup.name }}
460+
</Text>
460461
</Flex>
461-
</NuxtLink>
462-
</Flex>
463-
464-
<Button @click="handleDownload" type="secondary" size="small" wide>
465-
<Icon name="download" size="14" color="secondary" />
466-
<Text>Download</Text>
467-
</Button>
462+
</Flex>
463+
</NuxtLink>
468464
</Flex>
469465
</Flex>
470466

0 commit comments

Comments
 (0)