mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-14 09:14:52 +01:00
fixes
This commit is contained in:
parent
8316a1ab8b
commit
148f11fc4f
@ -1,7 +1,7 @@
|
||||
require('dotenv').config()
|
||||
|
||||
const siteContent = require('./content/site.json')
|
||||
const { appConfig } = require('./app.config')
|
||||
const appConfig = require('./app.config')
|
||||
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
|
@ -1,16 +1,8 @@
|
||||
import React, { ReactElement } from 'react'
|
||||
import { OceanProvider } from '@oceanprotocol/react'
|
||||
import { ConfigHelper } from '@oceanprotocol/lib'
|
||||
import { web3ModalOpts } from '../utils/wallet'
|
||||
import { web3ModalOpts, getOceanConfig } from '../utils/wallet'
|
||||
import { network } from '../../app.config'
|
||||
|
||||
function getOceanConfig(network: string) {
|
||||
return new ConfigHelper().getConfig(
|
||||
network,
|
||||
process.env.GATSBY_INFURA_PROJECT_ID
|
||||
)
|
||||
}
|
||||
|
||||
export default function wrapRootElement({
|
||||
element
|
||||
}: {
|
||||
@ -18,15 +10,9 @@ export default function wrapRootElement({
|
||||
}): ReactElement {
|
||||
const oceanInitialConfig = getOceanConfig(network)
|
||||
|
||||
async function handleNetworkChanged(chainId: number) {
|
||||
const config = getOceanConfig(chainId)
|
||||
connect(config)
|
||||
}
|
||||
|
||||
return (
|
||||
<OceanProvider
|
||||
initialConfig={oceanInitialConfig}
|
||||
handleNetworkChanged={handleNetworkChanged}
|
||||
web3ModalOpts={web3ModalOpts}
|
||||
>
|
||||
{element}
|
||||
|
@ -1,7 +1,13 @@
|
||||
import loadable from '@loadable/component'
|
||||
import { appConfig } from '../../app.config'
|
||||
import { infuraProjectId, network } from '../../app.config'
|
||||
import { ConfigHelper } from '@oceanprotocol/lib'
|
||||
|
||||
const { infuraProjectId, network, oceanConfig } = appConfig
|
||||
export function getOceanConfig(network: string): ConfigHelper {
|
||||
return new ConfigHelper().getConfig(
|
||||
network,
|
||||
process.env.GATSBY_INFURA_PROJECT_ID
|
||||
)
|
||||
}
|
||||
|
||||
const web3ModalTheme = {
|
||||
background: 'var(--brand-white)',
|
||||
@ -27,7 +33,7 @@ const providerOptions = {
|
||||
package: Torus,
|
||||
options: {
|
||||
networkParams: {
|
||||
host: oceanConfig.url // optional
|
||||
// host: oceanConfig.url // optional
|
||||
// chainId: 1337, // optional
|
||||
// networkId: 1337 // optional
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user