Skip to content

Commit

Permalink
Show contract label on contract page
Browse files Browse the repository at this point in the history
  • Loading branch information
Destiner committed Apr 23, 2024
1 parent 2f24542 commit 5830dcf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pages/contract/[address].vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="link">← Go Back</div>
</router-link>
<div class="header-details">
<div class="subtitle">Contract</div>
<div class="subtitle">{{ label }}</div>
<div class="title">
<h1>{{ address }}</h1>
<ButtonCopy :value="address" />
Expand All @@ -29,6 +29,7 @@ import { type Address, type Hex, createPublicClient, http } from 'viem';
import { computed, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import addresses from '@/addresses.json';
import BlockInfo from '@/components/contract/BlockInfo.vue';
import type { Status } from '@/components/contract/BlockStatus.vue';
import ButtonCopy from '@/components/contract/ButtonCopy.vue';
Expand All @@ -43,6 +44,12 @@ import {
const route = useRoute();
const address = computed(() => route.params.address as Address);
const label = computed(
() =>
(addresses as Record<Address, string | undefined>)[
address.value.toLowerCase() as Address
] || 'Contract',
);
// eslint-disable-next-line no-undef
useHead({
Expand Down

0 comments on commit 5830dcf

Please sign in to comment.