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 { OceanProvider } from '@oceanprotocol/react'
|
||||
import { web3ModalOpts, getOceanConfig } from '../utils/wallet'
|
||||
import { network } from '../../app.config'
|
||||
import { ConfigHelper } from '@oceanprotocol/lib'
|
||||
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({
|
||||
element
|
||||
}: {
|
||||
element: ReactElement
|
||||
}): ReactElement {
|
||||
const oceanInitialConfig = getOceanConfig(network)
|
||||
const { appConfig } = useSiteMetadata()
|
||||
const oceanInitialConfig = getOceanConfig(appConfig.network)
|
||||
|
||||
return (
|
||||
<OceanProvider
|
||||
|
@ -1,13 +1,5 @@
|
||||
import loadable from '@loadable/component'
|
||||
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 = {
|
||||
background: 'var(--brand-white)',
|
||||
|
Loading…
Reference in New Issue
Block a user