11import { Box , Heading , Text , Link } from "theme-ui" ;
22import moment from "moment" ;
33
4+ const EXPLORER_URL = process ?. env ?. NEAR_ENV == 'mainnet' ?
5+ 'https://explorer.near.org' : 'https://explorer.testnet.near.org' ;
46
57type historyProps = {
68 type : string
@@ -49,7 +51,7 @@ function HistoryItemLayout(
4951 color : 'gray.8'
5052 }
5153 } }
52- href = { `https://explorer.testnet.near.org /blocks/${ blockHash58 } ` } target = { "_blank" } >
54+ href = { `${ EXPLORER_URL } /blocks/${ blockHash58 } ` } target = { "_blank" } >
5355 < Text >
5456 { moment ( Number ( timestamp ) / 1000000 ) . format ( "dddd, DD MMMM YYYY, HH:mm:ss" ) }
5557 </ Text >
@@ -62,42 +64,42 @@ function HistoryItemLayout(
6264function Burn ( { accountId } : { accountId : string } ) {
6365 return (
6466 < Box >
65- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > burned this NFT.
67+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > burned this NFT.
6668 </ Box >
6769 )
6870}
6971
7072function Mint ( { accountId } : { accountId : string } ) {
7173 return (
7274 < Box >
73- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > minted this NFT.
75+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > minted this NFT.
7476 </ Box >
7577 )
7678}
7779
7880function Bid ( { accountId } : { accountId : string } ) {
7981 return (
8082 < Box >
81- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > placed a bid.
83+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > placed a bid.
8284 </ Box >
8385 )
8486}
8587
8688function BidRemove ( { accountId } : { accountId : string } ) {
8789 return (
8890 < Box >
89- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > removed their bid.
91+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > removed their bid.
9092 </ Box >
9193 )
9294}
9395
9496function BidAccept ( { accountId, receiverId } : { accountId : string , receiverId : string } ) {
9597 return (
9698 < Box >
97- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } >
99+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } >
98100 { accountId }
99101 </ Link > accepted{ " " }
100- < Link href = { `https://explorer.testnet.near.org /accounts/${ receiverId } ` } target = { "_blank" } >
102+ < Link href = { `${ EXPLORER_URL } /accounts/${ receiverId } ` } target = { "_blank" } >
101103 { receiverId }
102104 </ Link >
103105 's bid.
@@ -108,7 +110,7 @@ function BidAccept({ accountId, receiverId } : { accountId : string, receiverId:
108110function BidUpdate ( { accountId } : { accountId : string } ) {
109111 return (
110112 < Box >
111- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > updated their bid.
113+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } > { accountId } </ Link > updated their bid.
112114 </ Box >
113115 )
114116}
@@ -117,10 +119,10 @@ function BidUpdate({ accountId } : { accountId : string }){
117119function Transfer ( { accountId, receiverId } : { accountId : string , receiverId : string } ) {
118120 return (
119121 < Box >
120- < Link href = { `https://explorer.testnet.near.org /accounts/${ accountId } ` } target = { "_blank" } >
122+ < Link href = { `${ EXPLORER_URL } /accounts/${ accountId } ` } target = { "_blank" } >
121123 { accountId }
122124 </ Link > transferred this NFT to{ " " }
123- < Link href = { `https://explorer.testnet.near.org /accounts/${ receiverId } ` } target = { "_blank" } >
125+ < Link href = { `${ EXPLORER_URL } /accounts/${ receiverId } ` } target = { "_blank" } >
124126 { receiverId }
125127 </ Link >
126128 </ Box >
0 commit comments