Skip to content

Commit

Permalink
fix(components): Use block_hash_58 for history links
Browse files Browse the repository at this point in the history
  • Loading branch information
bestatigen committed Mar 30, 2022
1 parent eb1471e commit 023dc49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions packages/components/src/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ type historyProps = {
amount: number | null
sender?: { id : string | null } | null
recipient?: { id : string | null } | null
transactionHash: string
block_hash_58: string
}

function HistoryItemLayout(
{
children,
timestamp,
transactionHash
blockHash58
}
:
{
children: JSX.Element,
timestamp: string,
transactionHash: string
blockHash58: string
}
) {
return(
Expand Down Expand Up @@ -49,7 +49,7 @@ function HistoryItemLayout(
color: 'gray.8'
}
}}
href={`https://explorer.near.org/transactions/${transactionHash}`} target={"_blank"}>
href={`https://explorer.near.org/blocks/${blockHash58}`} target={"_blank"}>
<Text>
{moment(Number(timestamp)/1000000).format("dddd, DD MMMM YYYY, HH:MM:SS")}
</Text>
Expand Down Expand Up @@ -150,7 +150,7 @@ export function History ({ history = [] } : {
return(
<HistoryItemLayout
timestamp={ historyItem.timestamp }
transactionHash={ historyItem.transactionHash }
blockHash58={ historyItem.block_hash_58 }
>
<>
{historyItem.type == "burn" && <Burn accountId = {historyItem.sender!.id! }/> }
Expand Down
14 changes: 7 additions & 7 deletions packages/components/src/stories/History.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,49 @@ Tre.args = {
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578ggnkk98989787fbjby8"
block_hash_58: "5XK7taQRUen7xXAPUsnbMWW7eEEjV4vptK4Mp1qgPySB"
}, {
type: "set_bid",
timestamp: "1649199188285678087",
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578FFFbb5654fbjby8"
block_hash_58: "3hTEvKRs2iW12D4DMWgZGT3ZU53Y87dgNaKsaqZBrDAB"
}, {
type: "remove_bid",
timestamp: "1649199188285678087",
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578FFFbb5654fbjby8"
block_hash_58: "5g6SqmSfEDrAJsgrGnhGhZr1bCu8LALcQxqJoFyHBmb4"
}, {
type: "update_bid",
timestamp: "1649199188285678087",
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578FFFbb5654fbjby8"
block_hash_58: "5XK7taQRUen7xXAPUsnbMWW7eEEjV4vptK4Mp1qgPySB"
}, {
type: "accept_bid",
timestamp: "1649199188285678087",
sender: { id: "demo.testnet" },
amount: null,
recipient: {id : "demo2.testnet" },
transactionHash: "aayyx44578FFFbb5654fbjby8"
block_hash_58: "3hTEvKRs2iW12D4DMWgZGT3ZU53Y87dgNaKsaqZBrDAB"
},{
type: "burn",
timestamp: "1642599168285678017",
sender: { id: "demo.testnet" },
amount: null,
recipient: null,
transactionHash: "aayyx44578gg4666h583vvnkk98989787fbjby8"
block_hash_58: "5XK7taQRUen7xXAPUsnbMWW7eEEjV4vptK4Mp1qgPySB"
}, {
type: "transfer",
timestamp: "1642199908285679017",
sender: { id: "demo.testnet" },
recipient: {id : "demo2.testnet" },
amount: null,
transactionHash: "aadddJhjdB7889HUu?78dvfn89787fbjby8"
block_hash_58: "5XK7taQRUen7xXAPUsnbMWW7eEEjV4vptK4Mp1qgPySB"
}
]
}

0 comments on commit 023dc49

Please sign in to comment.