mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix fallback etherscan link
This commit is contained in:
parent
e14d4ad9e0
commit
1fa6303850
@ -2,6 +2,7 @@ import React, { ReactElement, ReactNode } from 'react'
|
|||||||
import { getNetworkName } from '../../utils/wallet'
|
import { getNetworkName } from '../../utils/wallet'
|
||||||
import { ReactComponent as External } from '../../images/external.svg'
|
import { ReactComponent as External } from '../../images/external.svg'
|
||||||
import styles from './EtherscanLink.module.css'
|
import styles from './EtherscanLink.module.css'
|
||||||
|
import { useSiteMetadata } from '../../hooks/useSiteMetadata'
|
||||||
|
|
||||||
export default function EtherscanLink({
|
export default function EtherscanLink({
|
||||||
networkId,
|
networkId,
|
||||||
@ -12,10 +13,15 @@ export default function EtherscanLink({
|
|||||||
path: string
|
path: string
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
|
const { appConfig } = useSiteMetadata()
|
||||||
const url =
|
const url =
|
||||||
networkId === 1
|
networkId === 1
|
||||||
? `https://etherscan.io`
|
? `https://etherscan.io`
|
||||||
: `https://${getNetworkName(networkId).toLowerCase()}.etherscan.io`
|
: `https://${
|
||||||
|
networkId
|
||||||
|
? getNetworkName(networkId).toLowerCase()
|
||||||
|
: appConfig.network
|
||||||
|
}.etherscan.io`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
|
Loading…
Reference in New Issue
Block a user