Skip to content

Commit 848fe7b

Browse files
committed
feat: Finalize testnet explorer URL
1 parent 15d1ec6 commit 848fe7b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/neuron-ui/src/components/Transaction/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,10 @@ const Transaction = () => {
246246
})
247247
}, [])
248248

249-
// TODO: add conditional branch on mainnet and testnet
250249
const onExplorerBtnClick = useCallback(() => {
251-
openExternal(`https://explorer.nervos.org/transaction/${transaction.hash}`)
250+
const isMainnet = false // TODO: add conditional branch on mainnet and testnet
251+
const explorerUrl = isMainnet ? 'https://explorer.nervos.org' : 'https://explorer.nervos.org/testnet'
252+
openExternal(`${explorerUrl}/transaction/${transaction.hash}`)
252253
}, [transaction.hash])
253254

254255
const basicInfoItems = useMemo(

packages/neuron-wallet/src/models/chain-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ export default class ChainInfo {
2727
if (this.isMainnet()) {
2828
return "https://explorer.nervos.org"
2929
}
30-
return "https://explorer.nervos.org" // TODO: change this to proper testnet explorer URL
30+
return "https://explorer.nervos.org/testnet"
3131
}
3232
}

0 commit comments

Comments
 (0)