Skip to content

Commit b188f73

Browse files
committed
Rework og images define
1 parent 80743d8 commit b188f73

9 files changed

Lines changed: 11 additions & 18 deletions

File tree

components/OgImage/StatsMetricImage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const bgStyles = computed(() => {
2323
<img src="/img/stats_bg.png" width="1200" height="600" class="absolute" v-bind="bgStyles" />
2424

2525
<div :style="{ height: '100%', display: 'flex', flexDirection: 'column', gap: '80px' }">
26-
<div :style="{ display: 'flex', alignItems: 'center' }">
26+
<div class="flex flex-row items-center">
2727
<span :style="{ fontSize: '70px', color: 'rgba(255,255,255, 0.9)' }">stats</span>
2828
<span :style="{ fontSize: '70px', color: 'rgba(255,255,255, 0.3)' }">('</span>
2929
<span :style="{ fontSize: '50px', color: '#FF8351' }">

components/OgImage/ValidatorImage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ const bgStyles = computed(() => {
2929
<div :style="{ display: 'flex', alignItems: 'center' }">
3030
<span :style="{ fontSize: '60px', color: 'rgba(255,255,255, 0.9)' }">validator</span>
3131
<span :style="{ fontSize: '60px', color: 'rgba(255,255,255, 0.3)' }">('</span>
32-
<span :style="{ fontSize: '40px', color: '#FF8351' }"> celestiavaloper•••{{ validator.address.slice(-4) }} </span>
32+
<span :style="{ fontSize: '40px', color: '#FF8351' }"> celestiavaloper•••{{ validator.address.hash.slice(-4) }} </span>
3333
<span :style="{ fontSize: '60px', color: 'rgba(255,255,255, 0.3)' }">')</span>
3434
</div>
3535

36-
<span :style="{ fontSize: '46px', color: 'rgba(255,255,255, 0.9)' }">
36+
<span v-if="validator.moniker" :style="{ fontSize: '46px', color: 'rgba(255,255,255, 0.9)' }">
3737
{{ validator.moniker }}
3838
</span>
3939

pages/address/[hash].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ if (!rawAddress.value) {
2424
cacheStore.current.address = address.value
2525
}
2626
27-
defineOgImage({
27+
defineOgImageComponent("AddressImage", {
2828
title: "Address",
2929
address: address.value,
30-
component: "AddressImage",
3130
cacheKey: `${address.value?.hash.slice(-4)}-${address.value?.balance.spendable}-${address.value?.first_height}-${
3231
address.value?.last_height
3332
}`,

pages/block/[height].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ if (!rawBlock.value) {
3232
cacheStore.current.block = block.value
3333
}
3434
35-
defineOgImage({
35+
defineOgImageComponent("BlockImage", {
3636
title: "Block",
3737
block: block.value,
38-
component: "BlockImage",
3938
cacheKey: `${block.value?.height}`,
4039
})
4140

pages/namespace/[id].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ if (!rawNamespace.value) {
2626
cacheStore.current.namespace = namespace.value
2727
}
2828
29-
defineOgImage({
29+
defineOgImageComponent("NamespaceImage", {
3030
title: "Namespace",
3131
namespace: namespace.value,
32-
component: "NamespaceImage",
3332
cacheKey: `${namespace.value?.hash}`,
3433
})
3534

pages/rollup/[slug].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ if (!rawRollup.value) {
2626
cacheStore.current.rollup = rollup.value
2727
}
2828
29-
defineOgImage({
29+
defineOgImageComponent("RollupImage", {
3030
title: "Rollup",
3131
rollup: rollup.value,
32-
component: "RollupImage",
3332
cacheKey: `${rollup.value?.name}`,
3433
})
3534

pages/rollup/rank/[slug].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@ const fetchData = async () => {
138138
}
139139
await fetchData()
140140
141-
defineOgImage({
141+
defineOgImageComponent("RollupImage", {
142142
title: "Rollup",
143143
rollup: rollup.value,
144-
component: "RollupImage",
145144
cacheKey: `${rollup.value?.name}`,
146145
})
147146

pages/stats/[metric].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ if (!series.value?.page) {
5555
}
5656
}
5757
58-
defineOgImage({
58+
defineOgImageComponent("StatsMetricImage", {
5959
title: "Statistics",
6060
series: series.value,
61-
component: "StatsMetricImage",
6261
cacheKey: `${series.value?.page}`,
6362
})
6463

pages/validator/[id].vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ if (!rawValidator.value) {
2525
cacheStore.current.validator = validator.value
2626
}
2727
28-
defineOgImage({
28+
defineOgImageComponent("ValidatorImage", {
2929
title: "Validator",
3030
validator: validator.value,
31-
component: "ValidatorImage",
32-
cacheKey: `${validator.value?.moniker}`,
31+
cacheKey: `${validator.value?.moniker || validator.value.address.hash}`,
3332
})
3433
3534
useHead({

0 commit comments

Comments
 (0)