Skip to content

Commit 5e87ffe

Browse files
committed
Add link from blobs widget
1 parent 86b229b commit 5e87ffe

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

components/DatePicker.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ const handleMonthChange = (v) => {
131131

132132
<Text color="secondary">Date Range</Text>
133133

134-
<template v-if="startDate.ts">
134+
<template v-if="from">
135135
<div :class="$style.vertical_divider" />
136136

137137
<Text size="12" weight="600" color="primary">
138-
{{ endDate.ts ? `${startDate.toFormat('LLL dd')} - ${endDate.toFormat('LLL dd')}` : startDate.toFormat('LLL dd') }}
138+
{{ (endDate.ts && startDate.toFormat('LLL dd') !== endDate?.toFormat('LLL dd')) ? `${startDate.toFormat('LLL dd')} - ${endDate.toFormat('LLL dd')}` : startDate.toFormat('LLL dd') }}
139139
</Text>
140140

141141
<Icon @click.stop="handleClear" name="close-circle" size="12" color="secondary" />

components/widgets/BlobsWidget.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { formatBytes } from "@/services/utils"
1111
/** API */
1212
import { fetchSeries } from "@/services/api/stats"
1313
14+
const router = useRouter()
15+
1416
const days = ref([])
1517
const weeks = ref([])
1618
@@ -80,6 +82,12 @@ const calculateOpacity = (val) => {
8082
8183
return opacity
8284
}
85+
86+
const selectDay = (d) => {
87+
let from = parseInt(DateTime.fromISO(d.time).startOf('day').ts / 1_000)
88+
let to = parseInt(DateTime.fromISO(d.time).endOf('day').ts / 1_000)
89+
router.push(`/txs?message_type=MsgPayForBlobs&from=${from}&to=${to}`)
90+
}
8391
</script>
8492

8593
<template>
@@ -102,6 +110,7 @@ const calculateOpacity = (val) => {
102110
<Flex v-for="week in weeks" direction="column" justify="between">
103111
<Tooltip v-for="day in week" :disabled="!day">
104112
<Flex
113+
@click="selectDay(day)"
105114
:class="[$style.day, day?.value > 0 && $style.shadow]"
106115
:style="{
107116
background: parseInt(day?.value) > 0 ? `rgb(10, 219, 111)` : 'var(--op-10)',

0 commit comments

Comments
 (0)