Skip to content

Commit

Permalink
Show short-address for unregistered validators in StakingInfoPage
Browse files Browse the repository at this point in the history
Fixes #200.
  • Loading branch information
sisou committed Nov 21, 2024
1 parent cacadce commit a951675
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/components/staking/StakingInfoPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<div class="staking-info-page flex-column">
<PageHeader :backArrow="false">
<template v-if="validator">
{{ $t(
'Staking with {validator}',
{ validator: 'name' in validator ? validator.name : validator.address.substr(0, 9) },
) }}
<i18n path="Staking with {validator}" :tag="false">
<template v-if="'name' in validator" slot="validator">
{{ validator.name }}
</template>
<template v-else slot="validator">
<ShortAddress :address="validator.address" />
</template>
</i18n>
</template>
<template v-else>
{{ $t('Staking') }}
Expand Down Expand Up @@ -433,6 +437,23 @@ export default defineComponent({
.page-header {
padding-bottom: 3rem;
::v-deep h1 {
display: flex;
justify-content: center;
gap: 0.25em;
flex-wrap: wrap;
}
.short-address {
display: inline-flex;
::v-deep .address {
line-height: inherit;
font-family: inherit;
font-weight: inherit;
}
}
}
.page-body {
Expand Down

0 comments on commit a951675

Please sign in to comment.