From 781b92a8c06889ab81d8c0d0bcc17fd35fb57c72 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 29 Oct 2020 10:45:44 +0800 Subject: [PATCH] Explorer: Linkify all displays of slot number (#13262) --- explorer/src/components/account/SlotHashesCard.tsx | 3 ++- explorer/src/components/account/SysvarAccountSection.tsx | 9 ++++++--- explorer/src/components/account/TokenHistoryCard.tsx | 4 ++-- .../src/components/account/TransactionHistoryCard.tsx | 2 +- explorer/src/components/account/VoteAccountSection.tsx | 6 +++++- explorer/src/components/account/VotesCard.tsx | 3 ++- explorer/src/pages/ClusterStatsPage.tsx | 2 +- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/explorer/src/components/account/SlotHashesCard.tsx b/explorer/src/components/account/SlotHashesCard.tsx index 4ae804f621..d508e980d9 100644 --- a/explorer/src/components/account/SlotHashesCard.tsx +++ b/explorer/src/components/account/SlotHashesCard.tsx @@ -1,3 +1,4 @@ +import { Slot } from "components/common/Slot"; import React from "react"; import { SysvarAccount, @@ -51,7 +52,7 @@ const renderAccountRow = (entry: SlotHashEntry, index: number) => { return ( - {entry.slot.toLocaleString("en-US")} + {entry.hash} diff --git a/explorer/src/components/account/SysvarAccountSection.tsx b/explorer/src/components/account/SysvarAccountSection.tsx index 4aae3971eb..b6e910cfba 100644 --- a/explorer/src/components/account/SysvarAccountSection.tsx +++ b/explorer/src/components/account/SysvarAccountSection.tsx @@ -19,6 +19,7 @@ import { AccountBalanceRow, } from "components/common/Account"; import { displayTimestamp } from "utils/date"; +import { Slot } from "components/common/Slot"; export function SysvarAccountSection({ account, @@ -171,7 +172,7 @@ function SysvarAccountSlotHistory({ {history.map((val) => (

- {val} +

))} @@ -281,7 +282,7 @@ function SysvarAccountEpochScheduleCard({ First Normal Slot - {sysvarAccount.info.firstNormalSlot} + @@ -329,7 +330,9 @@ function SysvarAccountClockCard({ Slot - {sysvarAccount.info.slot} + + + diff --git a/explorer/src/components/account/TokenHistoryCard.tsx b/explorer/src/components/account/TokenHistoryCard.tsx index 7e2d1e8f39..71646356ad 100644 --- a/explorer/src/components/account/TokenHistoryCard.tsx +++ b/explorer/src/components/account/TokenHistoryCard.tsx @@ -276,7 +276,7 @@ const TokenTransactionRow = React.memo( return ( - + @@ -327,7 +327,7 @@ const TokenTransactionRow = React.memo( return ( - + diff --git a/explorer/src/components/account/TransactionHistoryCard.tsx b/explorer/src/components/account/TransactionHistoryCard.tsx index cfd6a5120c..0973cadc24 100644 --- a/explorer/src/components/account/TransactionHistoryCard.tsx +++ b/explorer/src/components/account/TransactionHistoryCard.tsx @@ -72,7 +72,7 @@ export function TransactionHistoryCard({ pubkey }: { pubkey: PublicKey }) { detailsList.push( - + diff --git a/explorer/src/components/account/VoteAccountSection.tsx b/explorer/src/components/account/VoteAccountSection.tsx index 6fb190e024..1611fdad4f 100644 --- a/explorer/src/components/account/VoteAccountSection.tsx +++ b/explorer/src/components/account/VoteAccountSection.tsx @@ -9,6 +9,7 @@ import { AccountAddressRow, AccountBalanceRow, } from "components/common/Account"; +import { Slot } from "components/common/Slot"; export function VoteAccountSection({ account, @@ -18,6 +19,7 @@ export function VoteAccountSection({ voteAccount: VoteAccount; }) { const refresh = useFetchAccountInfo(); + const rootSlot = voteAccount.info.rootSlot; return (
Root Slot - {voteAccount.info.rootSlot} + + {rootSlot !== null ? : "N/A"} +
diff --git a/explorer/src/components/account/VotesCard.tsx b/explorer/src/components/account/VotesCard.tsx index 2d5feb0278..4db06d6764 100644 --- a/explorer/src/components/account/VotesCard.tsx +++ b/explorer/src/components/account/VotesCard.tsx @@ -1,3 +1,4 @@ +import { Slot } from "components/common/Slot"; import React from "react"; import { VoteAccount, Vote } from "validators/accounts/vote"; @@ -44,7 +45,7 @@ const renderAccountRow = (vote: Vote, index: number) => { return ( - {vote.slot.toLocaleString("en-US")} + {vote.confirmationCount} diff --git a/explorer/src/pages/ClusterStatsPage.tsx b/explorer/src/pages/ClusterStatsPage.tsx index 21c7937d7d..75644be3fd 100644 --- a/explorer/src/pages/ClusterStatsPage.tsx +++ b/explorer/src/pages/ClusterStatsPage.tsx @@ -69,7 +69,7 @@ function StatsCardBody() { Slot - + {blockHeight !== undefined && (