mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
refactor
This commit is contained in:
parent
148f11fc4f
commit
062530f523
@ -1,14 +1,23 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import { OceanProvider } from '@oceanprotocol/react'
|
import { OceanProvider } from '@oceanprotocol/react'
|
||||||
import { web3ModalOpts, getOceanConfig } from '../utils/wallet'
|
import { ConfigHelper } from '@oceanprotocol/lib'
|
||||||
import { network } from '../../app.config'
|
import { web3ModalOpts } from '../utils/wallet'
|
||||||
|
import { useSiteMetadata } from '../hooks/useSiteMetadata'
|
||||||
|
|
||||||
|
function getOceanConfig(network: string): ConfigHelper {
|
||||||
|
return new ConfigHelper().getConfig(
|
||||||
|
network,
|
||||||
|
process.env.GATSBY_INFURA_PROJECT_ID
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export default function wrapRootElement({
|
export default function wrapRootElement({
|
||||||
element
|
element
|
||||||
}: {
|
}: {
|
||||||
element: ReactElement
|
element: ReactElement
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const oceanInitialConfig = getOceanConfig(network)
|
const { appConfig } = useSiteMetadata()
|
||||||
|
const oceanInitialConfig = getOceanConfig(appConfig.network)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OceanProvider
|
<OceanProvider
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
import loadable from '@loadable/component'
|
import loadable from '@loadable/component'
|
||||||
import { infuraProjectId, network } from '../../app.config'
|
import { infuraProjectId, network } from '../../app.config'
|
||||||
import { ConfigHelper } from '@oceanprotocol/lib'
|
|
||||||
|
|
||||||
export function getOceanConfig(network: string): ConfigHelper {
|
|
||||||
return new ConfigHelper().getConfig(
|
|
||||||
network,
|
|
||||||
process.env.GATSBY_INFURA_PROJECT_ID
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const web3ModalTheme = {
|
const web3ModalTheme = {
|
||||||
background: 'var(--brand-white)',
|
background: 'var(--brand-white)',
|
||||||
|
Loading…
Reference in New Issue
Block a user