Skip to content

Commit

Permalink
add hyperlink to for l1 tx (#31)
Browse files Browse the repository at this point in the history
* add hyperlink to for li tx

* rename

Co-authored-by: HAOYUatHZ <[email protected]>
  • Loading branch information
zzq0826 and 0xmountaintop authored Nov 22, 2021
1 parent 83b1434 commit 74a49fc
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_CONTRACT_ADDRESS=0x5fbdb2315678afecb367f032d93f642f64180aa3
REACT_APP_NETWORK=0
REACT_APP_NETWORK=0
REACT_APP_L1_EXPLORER_BASE_URL=http://18.180.248.43:4000/
3 changes: 2 additions & 1 deletion .env.goerli
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_NETWORK=5
REACT_APP_NETWORK=5
REACT_APP_L1_EXPLORER_BASE_URL=https://goerli.etherscan.io/
2 changes: 2 additions & 0 deletions .env.kovan
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_NETWORK=42
REACT_APP_L1_EXPLORER_BASE_URL=https://kovan.etherscan.io/
2 changes: 2 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_NETWORK=1
REACT_APP_L1_EXPLORER_BASE_URL=https://etherscan.io/
2 changes: 2 additions & 0 deletions .env.rinkeby
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_NETWORK=4
REACT_APP_L1_EXPLORER_BASE_URL=https://rinkeby.etherscan.io/
2 changes: 2 additions & 0 deletions .env.ropsten
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_NETWORK=3
REACT_APP_L1_EXPLORER_BASE_URL=https://ropsten.etherscan.io/
13 changes: 12 additions & 1 deletion src/containers/Layer2Explorer/block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const TYPE_MAP = {
TRANSFER: "transfer_tx",
NOP: "nop",
};

class BlockDetail extends Component {
state = {
activeExpanedRow: null,
Expand Down Expand Up @@ -95,6 +96,7 @@ class BlockDetail extends Component {
render() {
const { lang, blockId } = this.props;
const { loading, blockInfo } = this.state;
const L1_EXPLORER_BASE_URL = process.env.REACT_APP_L1_EXPLORER_BASE_URL;
const columns = [
{
key: "hash",
Expand Down Expand Up @@ -171,7 +173,16 @@ class BlockDetail extends Component {
<Col lg={8}>
<h4>{i18n(lang, "L1_TX_HASH")}</h4>
</Col>
<Col lg={16}>{blockInfo.l1_tx_hash}</Col>
<Col lg={16}>
<a
href={`${L1_EXPLORER_BASE_URL}tx/${blockInfo.l1_tx_hash}`}
target="_blank"
rel="noreferrer"
className={styles.linkText}
>
{blockInfo.l1_tx_hash}
</a>
</Col>
</>
)}
</Row>
Expand Down

0 comments on commit 74a49fc

Please sign in to comment.