Explorer: Display block utc timestamp in account history (#28248)
This commit is contained in:
parent
435d4aded9
commit
40ebebe140
|
@ -15,6 +15,7 @@ import {
|
||||||
import { FetchStatus } from "providers/cache";
|
import { FetchStatus } from "providers/cache";
|
||||||
import { LoadingCard } from "components/common/LoadingCard";
|
import { LoadingCard } from "components/common/LoadingCard";
|
||||||
import { ErrorCard } from "components/common/ErrorCard";
|
import { ErrorCard } from "components/common/ErrorCard";
|
||||||
|
import { displayTimestampUtc } from "utils/date";
|
||||||
|
|
||||||
export function TransactionHistoryCard({ pubkey }: { pubkey: PublicKey }) {
|
export function TransactionHistoryCard({ pubkey }: { pubkey: PublicKey }) {
|
||||||
const address = pubkey.toBase58();
|
const address = pubkey.toBase58();
|
||||||
|
@ -56,7 +57,7 @@ export function TransactionHistoryCard({ pubkey }: { pubkey: PublicKey }) {
|
||||||
return (
|
return (
|
||||||
<tr key={signature}>
|
<tr key={signature}>
|
||||||
<td>
|
<td>
|
||||||
<Signature signature={signature} link truncate />
|
<Signature signature={signature} link truncateChars={60} />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td className="w-1">
|
<td className="w-1">
|
||||||
|
@ -64,9 +65,16 @@ export function TransactionHistoryCard({ pubkey }: { pubkey: PublicKey }) {
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{hasTimestamps && (
|
{hasTimestamps && (
|
||||||
<td className="text-muted">
|
<>
|
||||||
{blockTime ? <Moment date={blockTime * 1000} fromNow /> : "---"}
|
<td className="text-muted">
|
||||||
</td>
|
{blockTime ? <Moment date={blockTime * 1000} fromNow /> : "---"}
|
||||||
|
</td>
|
||||||
|
<td className="text-muted">
|
||||||
|
{blockTime
|
||||||
|
? displayTimestampUtc(blockTime * 1000, true)
|
||||||
|
: "---"}
|
||||||
|
</td>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
@ -90,8 +98,13 @@ export function TransactionHistoryCard({ pubkey }: { pubkey: PublicKey }) {
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th className="text-muted w-1">Transaction Signature</th>
|
<th className="text-muted w-1">Transaction Signature</th>
|
||||||
<th className="text-muted w-1">Slot</th>
|
<th className="text-muted w-1">Block</th>
|
||||||
{hasTimestamps && <th className="text-muted w-1">Age</th>}
|
{hasTimestamps && (
|
||||||
|
<>
|
||||||
|
<th className="text-muted w-1">Age</th>
|
||||||
|
<th className="text-muted w-1">Timestamp</th>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<th className="text-muted">Result</th>
|
<th className="text-muted">Result</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
Loading…
Reference in New Issue