Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/18 block explorer transaction UI first pass #36

Merged
merged 22 commits into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8abde72
Created unstyled block explorer transaction and added Prism for code …
sam-keen Feb 26, 2022
fb7042f
setup a basic transactions home component to work on
sam-keen Feb 26, 2022
c312a8f
Created unstyled block explorer blocks page, with new refresh method …
sam-keen Mar 2, 2022
c06e73b
Test of running nx in yarn from pre-commit
sam-keen Mar 2, 2022
f376f3c
Created a new route for pending transactions to live for now
sam-keen Mar 2, 2022
0dff355
Transactions route set up and a component to show the transactions pe…
sam-keen Mar 3, 2022
c659cb8
Updated block id page to use project components
sam-keen Mar 3, 2022
c97c3db
Added Table presentational component for a little cleanup
sam-keen Mar 3, 2022
5f983d2
Added validator link to block id route
sam-keen Mar 3, 2022
cc4b2b9
Update apps/explorer/src/app/components/txs/txs-per-block/index.tsx
Mar 3, 2022
7a5844c
Update apps/explorer/src/app/hooks/use-fetch.tsx
Mar 3, 2022
1917a87
Update apps/explorer/src/app/hooks/use-fetch.tsx
Mar 3, 2022
98e4eca
Put pending under txs route
sam-keen Mar 3, 2022
a1f28fc
Added a couple of links to nav around more happily
sam-keen Mar 3, 2022
2d2e17f
Moved to use syntax-highlighter instead of prism
sam-keen Mar 3, 2022
0f3c457
Removed prism theme
sam-keen Mar 3, 2022
92ddce6
Kebab cased component file names
sam-keen Mar 3, 2022
3399bdd
Added key to a non-shorthand react fragment
sam-keen Mar 3, 2022
929e929
add basic tailwind setup
dexturr Mar 3, 2022
a6e45b1
put back css, remove uneeded file
dexturr Mar 3, 2022
d8061fb
point BE at mainnet
dexturr Mar 4, 2022
81096fa
lockfile back
dexturr Mar 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added validator link to block id route
  • Loading branch information
sam-keen authored and dexturr committed Mar 4, 2022
commit 5f983d246aaa06fb40f6e592a8de4e0e718b3fa8
14 changes: 6 additions & 8 deletions apps/explorer/src/app/components/blocks/home/blocksTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ export const BlocksTable = ({ data, showTransactions }: BlocksProps) => {
? '1 transaction'
: `${block.num_txs} transactions`}
</td>
{block.header?.proposer_address && (
<td>
<Link to={`/validators/${block.header.proposer_address}`}>
{block.header.proposer_address}
</Link>
</td>
)}
<td>
<Link to={`/validators/${block.header?.proposer_address}`}>
{block.header.proposer_address}
</Link>
</td>
<td>
<SecondsAgo date={block.header?.time} />
</td>
</tr>
{showTransactions && (
<tr>
<TxsPerBlock blockHeight={block.header.height} />
<TxsPerBlock blockHeight={block.header?.height} />
</tr>
)}
</>
Expand Down
16 changes: 13 additions & 3 deletions apps/explorer/src/app/routes/blocks/id/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { useParams } from 'react-router-dom';
import { Link, useParams } from 'react-router-dom';
import { DATA_SOURCES } from '../../../config';
import useFetch from '../../../hooks/use-fetch';
import { TendermintBlocksResponse } from '../tendermint-blocks-response';
Expand All @@ -15,18 +15,28 @@ const Block = () => {
`${DATA_SOURCES.tendermintUrl}/block?height=${block}`
);

const header = blockData?.result.block.header;

if (!header) {
return <>Could not get block data</>;
}

return (
<section>
<h1>BLOCK {block}</h1>
<Table>
<tr>
<td>Mined by</td>
<td>{blockData?.result.block.header?.proposer_address}</td>
<td>
<Link to={`/validators/${header.proposer_address}`}>
{header.proposer_address}
</Link>
</td>
</tr>
<tr>
<td>Time</td>
<td>
<SecondsAgo date={blockData?.result.block.header?.time} />
<SecondsAgo date={header.time} />
</td>
</tr>
</Table>
Expand Down