mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Fix broken explorer links for multinetwork (#761)
* external link get oceanConfing when undefined, use chainId for pools * pass chainId to editHistory explorerLinks * remove ddo check from Pool explorer link * removed chainId verfication from datatoken external link path * add Gaia-X chainId verification to pool datatoken external link * add chainId check for Moonbeam
This commit is contained in:
parent
7279a642f6
commit
a7c1db215e
src/components
@ -33,7 +33,7 @@ export default function ExplorerLink({
|
|||||||
setOceanConfig(oceanInitialConfig)
|
setOceanConfig(oceanInitialConfig)
|
||||||
setUrl(oceanInitialConfig?.explorerUri)
|
setUrl(oceanInitialConfig?.explorerUri)
|
||||||
}
|
}
|
||||||
if (ocean === undefined) {
|
if (oceanConfig === undefined) {
|
||||||
initOcean()
|
initOcean()
|
||||||
}
|
}
|
||||||
}, [config, networkId, ocean])
|
}, [config, networkId, ocean])
|
||||||
|
@ -65,7 +65,7 @@ export default function Pool(): ReactElement {
|
|||||||
const data = useStaticQuery(contentQuery)
|
const data = useStaticQuery(contentQuery)
|
||||||
const content = data.content.edges[0].node.childContentJson.pool
|
const content = data.content.edges[0].node.childContentJson.pool
|
||||||
|
|
||||||
const { accountId, networkId } = useWeb3()
|
const { accountId } = useWeb3()
|
||||||
const { ocean } = useOcean()
|
const { ocean } = useOcean()
|
||||||
const { isInPurgatory, ddo, owner, price, refreshInterval, isAssetNetwork } =
|
const { isInPurgatory, ddo, owner, price, refreshInterval, isAssetNetwork } =
|
||||||
useAsset()
|
useAsset()
|
||||||
@ -278,15 +278,15 @@ export default function Pool(): ReactElement {
|
|||||||
<Tooltip content={content.tooltips.price} />
|
<Tooltip content={content.tooltips.price} />
|
||||||
<div className={styles.dataTokenLinks}>
|
<div className={styles.dataTokenLinks}>
|
||||||
<ExplorerLink
|
<ExplorerLink
|
||||||
networkId={networkId}
|
networkId={ddo.chainId}
|
||||||
path={`address/${price?.address}`}
|
path={`address/${price?.address}`}
|
||||||
>
|
>
|
||||||
Pool
|
Pool
|
||||||
</ExplorerLink>
|
</ExplorerLink>
|
||||||
<ExplorerLink
|
<ExplorerLink
|
||||||
networkId={networkId}
|
networkId={ddo.chainId}
|
||||||
path={
|
path={
|
||||||
networkId === 137 || networkId === 1287
|
ddo.chainId === 2021000 || ddo.chainId === 1287
|
||||||
? `tokens/${ddo.dataToken}`
|
? `tokens/${ddo.dataToken}`
|
||||||
: `token/${ddo.dataToken}`
|
: `token/${ddo.dataToken}`
|
||||||
}
|
}
|
||||||
|
@ -50,14 +50,14 @@ export default function EditHistory(): ReactElement {
|
|||||||
<ul className={styles.history}>
|
<ul className={styles.history}>
|
||||||
{receipts?.map((receipt) => (
|
{receipts?.map((receipt) => (
|
||||||
<li key={receipt.id} className={styles.item}>
|
<li key={receipt.id} className={styles.item}>
|
||||||
<ExplorerLink networkId={networkId} path={`/tx/${receipt.tx}`}>
|
<ExplorerLink networkId={ddo.chainId} path={`/tx/${receipt.tx}`}>
|
||||||
edited{' '}
|
edited{' '}
|
||||||
<Time date={receipt.timestamp.toString()} relative isUnix />
|
<Time date={receipt.timestamp.toString()} relative isUnix />
|
||||||
</ExplorerLink>
|
</ExplorerLink>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
<li className={styles.item}>
|
<li className={styles.item}>
|
||||||
<ExplorerLink networkId={networkId} path={`/tx/${creationTx}`}>
|
<ExplorerLink networkId={ddo.chainId} path={`/tx/${creationTx}`}>
|
||||||
published <Time date={ddo.created} relative />
|
published <Time date={ddo.created} relative />
|
||||||
</ExplorerLink>
|
</ExplorerLink>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user