1
0
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:
Matthias Kretschmann 2020-10-26 18:27:34 +01:00
parent e14d4ad9e0
commit 1fa6303850
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -2,6 +2,7 @@ import React, { ReactElement, ReactNode } from 'react'
import { getNetworkName } from '../../utils/wallet'
import { ReactComponent as External } from '../../images/external.svg'
import styles from './EtherscanLink.module.css'
import { useSiteMetadata } from '../../hooks/useSiteMetadata'
export default function EtherscanLink({
networkId,
@ -12,10 +13,15 @@ export default function EtherscanLink({
path: string
children: ReactNode
}): ReactElement {
const { appConfig } = useSiteMetadata()
const url =
networkId === 1
? `https://etherscan.io`
: `https://${getNetworkName(networkId).toLowerCase()}.etherscan.io`
: `https://${
networkId
? getNetworkName(networkId).toLowerCase()
: appConfig.network
}.etherscan.io`
return (
<a