Skip to content

Commit

Permalink
feat: Create a cell component to display block height and time (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
janmichek authored Oct 19, 2023
1 parent eb9284d commit 1bac63d
Show file tree
Hide file tree
Showing 44 changed files with 166 additions and 358 deletions.
11 changes: 3 additions & 8 deletions src/components/AccountActivitiesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@
</template>
</td>
<td>
<div>
<app-link
:to="`/keyblocks/${activity.height}`">
{{ activity.height }}
</app-link>
</div>
<datetime-label :datetime="activity.time"/>
<block-time-cell
:height="activity.height"
:datetime="activity.time"/>
</td>
<td>
<account-activity-type-cell
Expand All @@ -80,7 +76,6 @@
import AccountActivityCell from '@/components/AccountActivityCell'
import AccountActivityTypeCell from '@/components/AccountActivityTypeCell'
import AccountActivityDataCell from '@/components/AccountActivityDataCell'
import DatetimeLabel from '@/components/DatetimeLabel'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import { accountHints } from '@/utils/hints/accountHints'
import HintTooltip from '@/components/HintTooltip'
Expand Down
11 changes: 3 additions & 8 deletions src/components/AccountActivitiesTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@
</app-tooltip>
</th>
<td class="account-activities-table-condensed__data">
<div>
<app-link
:to="`/keyblocks/${activity.height}`">
{{ activity.height }}
</app-link>
</div>
<datetime-label :datetime="activity.time"/>
<block-time-cell
:height="activity.height"
:datetime="activity.time"/>
</td>
</tr>
<tr class="account-activities-table-condensed__row">
Expand Down Expand Up @@ -97,7 +93,6 @@
import AccountActivityCell from '@/components/AccountActivityCell'
import AccountActivityTypeCell from '@/components/AccountActivityTypeCell'
import AccountActivityDataCell from '@/components/AccountActivityDataCell'
import DatetimeLabel from '@/components/DatetimeLabel'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import { accountHints } from '@/utils/hints/accountHints'
import AppTooltip from '@/components/AppTooltip'
Expand Down
11 changes: 3 additions & 8 deletions src/components/AccountNamesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@
</app-link>
</td>
<td>
<div>
<app-link
:to="`/keyblocks/${name.expirationHeight}`">
{{ name.expirationHeight }}
</app-link>
</div>
<datetime-label :datetime="name.expires"/>
<block-time-cell
:height="name.expirationHeight"
:datetime="name.expiration"/>
</td>
<td>
<value-hash-ellipsed
Expand All @@ -55,7 +51,6 @@
<script setup>
import AppLink from '@/components/AppLink'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
import { accountHints } from '@/utils/hints/accountHints'
import HintTooltip from '@/components/HintTooltip'
Expand Down
11 changes: 3 additions & 8 deletions src/components/AccountNamesTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@
</app-tooltip>
</th>
<td class="account-names-table-condensed__data">
<div>
<app-link
:to="`/keyblocks/${name.expirationHeight}`">
{{ name.expirationHeight }}
</app-link>
</div>
<datetime-label :datetime="name.expires"/>
<block-time-cell
:height="name.expirationHeight"
:datetime="name.expiration"/>
</td>
</tr>
<tr class="account-names-table-condensed__row">
Expand Down Expand Up @@ -73,7 +69,6 @@
import AppLink from '@/components/AppLink'
import AppTooltip from '@/components/AppTooltip'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
import { accountHints } from '@/utils/hints/accountHints'
defineProps({
Expand Down
11 changes: 3 additions & 8 deletions src/components/AccountTransactionsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@
:link-to="`/transactions/${transaction.hash}`"/>
</td>
<td>
<div>
<app-link
:to="`/keyblocks/${transaction.createdHeight}`">
{{ transaction.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="transaction.created"/>
<block-time-cell
:height="transaction.createdHeight"
:datetime="transaction.created"/>
</td>
<td>
{{ transaction.type }}
Expand All @@ -64,7 +60,6 @@

<script setup>
import TransactionCell from '@/components/TransactionCell'
import DatetimeLabel from '@/components/DatetimeLabel'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import { accountHints } from '@/utils/hints/accountHints'
import HintTooltip from '@/components/HintTooltip'
Expand Down
11 changes: 3 additions & 8 deletions src/components/AccountTransactionsTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@
</app-tooltip>
</th>
<td class="account-transactions-table-condensed__data">
<div>
<app-link
:to="`/keyblocks/${transaction.createdHeight}`">
{{ transaction.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="transaction.created"/>
<block-time-cell
:height="transaction.createdHeight"
:datetime="transaction.created"/>
</td>
</tr>
<tr class="account-transactions-table-condensed__row">
Expand Down Expand Up @@ -82,7 +78,6 @@ import { transactionsHints } from '@/utils/hints/transactionsHints'
import { accountHints } from '@/utils/hints/accountHints'
import TransactionCell from '@/components/TransactionCell'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
import AppTooltip from '@/components/AppTooltip'
defineProps({
Expand Down
23 changes: 23 additions & 0 deletions src/components/BlockTimeCell.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<div>
<app-link
:to="`/keyblocks/${height}`">
{{ height }}
</app-link>
</div>
<datetime-label :datetime="datetime"/>
</template>

<script setup>
defineProps({
height: {
type: String,
required: true,
},
datetime: {
type: Object,
required: true,
},
})
</script>
11 changes: 3 additions & 8 deletions src/components/ContractCallTransactionsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@
:link-to="`/transactions/${transaction.hash}`"/>
</td>
<td>
<div>
<app-link
:to="`/keyblocks/${transaction.createdHeight}`">
{{ transaction.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="transaction.created"/>
<block-time-cell
:height="transaction.createdHeight"
:datetime="transaction.created"/>
</td>
<td>
<value-hash-ellipsed
Expand All @@ -68,7 +64,6 @@

<script setup>
import { contractsHints } from '@/utils/hints/contractsHints'
import DatetimeLabel from '@/components/DatetimeLabel'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import AppChip from '@/components/AppChip'
Expand Down
11 changes: 3 additions & 8 deletions src/components/ContractCallTransactionsTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@
</app-tooltip>
</th>
<td class="contract-call-transactions-table-condensed__data">
<div>
<app-link
:to="`/keyblocks/${transaction.createdHeight}`">
{{ transaction.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="transaction.created"/>
<block-time-cell
:height="transaction.createdHeight"
:datetime="transaction.created"/>
</td>
</tr>
<tr class="contract-call-transactions-table-condensed__row">
Expand Down Expand Up @@ -78,7 +74,6 @@
</template>

<script setup>
import DatetimeLabel from '@/components/DatetimeLabel'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import AppChip from '@/components/AppChip'
import { contractsHints } from '@/utils/hints/contractsHints'
Expand Down
11 changes: 3 additions & 8 deletions src/components/ContractEventsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@
:link-to="`/transactions/${event.callTxHash}`"/>
</td>
<td :class="[{'contract-events-table__data--expanded': isExpanded.includes(index)}]">
<div>
<app-link
:to="`/keyblocks/${event.createdHeight}`">
{{ event.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="event.created"/>
<block-time-cell
:height="event.createdHeight"
:datetime="event.created"/>
</td>
<td :class="[{'contract-events-table__data--expanded': isExpanded.includes(index)}]">
{{ event.eventName || 'N/A' }}
Expand Down Expand Up @@ -78,7 +74,6 @@

<script setup>
import { contractsHints } from '@/utils/hints/contractsHints'
import DatetimeLabel from '@/components/DatetimeLabel'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import EventDataPanel from '@/components/EventDataPanel'
import ExpandButton from '@/components/ExpandButton'
Expand Down
11 changes: 3 additions & 8 deletions src/components/ContractEventsTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@
</app-tooltip>
</th>
<td class="contract-events-table-condensed__data">
<div>
<app-link
:to="`/keyblocks/${event.createdHeight}`">
{{ event.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="event.created"/>
<block-time-cell
:height="event.createdHeight"
:datetime="event.created"/>
</td>
</tr>
<tr class="contract-events-table-condensed__row">
Expand Down Expand Up @@ -95,7 +91,6 @@
<script setup>
import { contractsHints } from '@/utils/hints/contractsHints'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
import ExpandButton from '@/components/ExpandButton'
const props = defineProps({
Expand Down
11 changes: 3 additions & 8 deletions src/components/ContractsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@
:hash="contract.contractId"/>
</td>
<td class="contracts-table__data">
<div>
<app-link
:to="`/keyblocks/${contract.createdHeight}`">
{{ contract.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="contract.created"/>
<block-time-cell
:height="contract.createdHeight"
:datetime="contract.created"/>
</td>
<td class="contracts-table__data">
<value-hash-ellipsed
Expand All @@ -63,7 +59,6 @@
<script setup>
import { contractsHints } from '@/utils/hints/contractsHints'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
import HintTooltip from '@/components/HintTooltip'
defineProps({
Expand Down
11 changes: 3 additions & 8 deletions src/components/ContractsTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@
</app-tooltip>
</th>
<td class="contracts-table-condensed__data">
<div>
<app-link
:to="`/keyblocks/${contract.createdHeight}`">
{{ contract.createdHeight }}
</app-link>
</div>
<datetime-label :datetime="contract.created"/>
<block-time-cell
:height="contract.createdHeight"
:datetime="contract.created"/>
</td>
</tr>
<tr class="contracts-table-condensed__row">
Expand Down Expand Up @@ -76,7 +72,6 @@

<script setup>
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
import { contractsHints } from '@/utils/hints/contractsHints'
defineProps({
Expand Down
11 changes: 3 additions & 8 deletions src/components/DashboardAuctionsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,9 @@
</td>
<td>
<div class="dashboard-auctions-table__blocks">
<app-link
:to="`/keyblocks/${auction.expirationHeight}`">
{{ auction.expirationHeight }}
</app-link>
</div>
<div>
<datetime-label :datetime="auction.expiration"/>
<block-time-cell
:height="auction.expirationHeight"
:datetime="auction.expiration"/>
</div>
</td>
</tr>
Expand All @@ -69,7 +65,6 @@ import { namesHints } from '@/utils/hints/namesHints'
import { useNamesStore } from '@/stores/names'
import { formatAePrice } from '@/utils/format'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
const { auctionsEndingSoon } = storeToRefs(useNamesStore())
</script>
Expand Down
11 changes: 3 additions & 8 deletions src/components/DashboardNamesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,9 @@
</td>
<td>
<div class="dashboard-names-table__blocks">
<app-link
:to="`/keyblocks/${name.activatedHeight}`">
{{ name.activatedHeight }}
</app-link>
</div>
<div>
<datetime-label :datetime="name.activated"/>
<block-time-cell
:height="name.activatedHeight"
:datetime="name.activated"/>
</div>
</td>
</tr>
Expand All @@ -72,7 +68,6 @@ import { namesHints } from '@/utils/hints/namesHints'
import { useNamesStore } from '@/stores/names'
import { formatAePrice, formatNullable } from '@/utils/format'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import DatetimeLabel from '@/components/DatetimeLabel'
const { recentlyActivatedNames } = storeToRefs(useNamesStore())
</script>
Expand Down
Loading

0 comments on commit 1bac63d

Please sign in to comment.