From cbdf2ad195701610f8c5e009b3f503c0beb42e23 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Sat, 23 May 2020 17:24:04 +0800 Subject: [PATCH] Add result and details link to account history table --- explorer/src/components/AccountDetails.tsx | 81 +++++++++++++++++----- explorer/src/scss/_solana.scss | 6 +- 2 files changed, 69 insertions(+), 18 deletions(-) diff --git a/explorer/src/components/AccountDetails.tsx b/explorer/src/components/AccountDetails.tsx index e467cce8bb9225..81de987028fbf0 100644 --- a/explorer/src/components/AccountDetails.tsx +++ b/explorer/src/components/AccountDetails.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { Link } from "react-router-dom"; import { useClusterModal } from "providers/cluster"; import { PublicKey, StakeProgram } from "@solana/web3.js"; import ClusterStatusButton from "components/ClusterStatusButton"; @@ -190,6 +191,9 @@ function HistoryCard({ pubkey }: { pubkey: PublicKey }) { } if (history.fetched.length === 0) { + if (history.status === FetchStatus.Fetching) { + return ; + } return ( { - return ( - - {signature} - + + slotTransactions.forEach(({ signature, status }, index) => { + let statusText; + let statusClass; + if (status.err) { + statusClass = "warning"; + statusText = "Failed"; + } else { + statusClass = "success"; + statusText = "Success"; + } + + detailsList.push( + + {index === 0 ? ( + {slot} + ) : ( + + + + )} + + + + {statusText} + + + + + + {signature} + + + + + ({ + ...location, + pathname: "/tx/" + signature + })} + className="btn btn-rounded-circle btn-white btn-sm" + > + + + + ); }); - - detailsList.push( - - Slot {slot} - -
- {signatures} -
- - - ); } const fetching = history.status === FetchStatus.Fetching; @@ -256,7 +290,20 @@ function HistoryCard({ pubkey }: { pubkey: PublicKey }) { - {detailsList} +
+ + + + + + + + + + {detailsList} +
SlotResultTransaction SignatureDetails
+
+