Skip to content

Commit eaed88c

Browse files
authored
Merge pull request #132 from hack-a-chain-software/feat/mini-dashboard-skeleton
feat: mini skeleton on blocks page
2 parents 6cc653b + 3fe3ea3 commit eaed88c

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

components/StatsGrid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defineProps({
1515
class="bg-[#111111] border border-[#222222] rounded-xl p-4 shadow-[0_0_20px_rgba(255,255,255,0.0625)]"
1616
>
1717
<p class="text-[12px] text-[#bbbbbb] mb-1 uppercase tracking-wider">{{ card.label }}</p>
18-
<p class="text-[19px] text-[#f5f5f5]">{{ card.value }}</p>
18+
<p class="text-[18px] text-[#f5f5f5]">{{ card.value }}</p>
1919
</div>
2020
</div>
2121
</template>

components/skeleton/StatsGrid.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-4">
3+
<div
4+
v-for="n in 4"
5+
:key="`skeleton-stats-card-${n}`"
6+
class="bg-[#111111] border border-[#222222] rounded-xl p-4 shadow-[0_0_20px_rgba(255,255,255,0.0625)]"
7+
>
8+
<div class="animate-pulse">
9+
<div class="h-4 bg-gray-600 rounded w-1/3 mb-2"></div>
10+
<div class="h-6 bg-gray-700 rounded w-1/2"></div>
11+
</div>
12+
</div>
13+
</div>
14+
</template>
15+
16+

pages/blocks/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { ref, watch, computed } from 'vue';
33
import IconDownload from '~/components/icon/Download.vue';
44
import StatsGrid from '~/components/StatsGrid.vue';
5+
import SkeletonStatsGrid from '~/components/skeleton/StatsGrid.vue';
56
import { useBlocksMetrics } from '~/composables/useBlocksMetrics';
67
import DataTable from '~/components/DataTable.vue';
78
import FilterSelect from '~/components/FilterSelect.vue';
@@ -237,7 +238,8 @@ function downloadData() {
237238
</h1>
238239
</div>
239240

240-
<StatsGrid v-if="!metricsLoading && !metricsError && metricsCards.length" :cards="metricsCards" />
241+
<SkeletonStatsGrid v-if="loading" />
242+
<StatsGrid v-else-if="!metricsError && metricsCards.length" :cards="metricsCards" />
241243

242244
<SkeletonTable v-if="loading" />
243245
<DataTable

0 commit comments

Comments
 (0)