1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

make metadataStoreUri part of app config

This commit is contained in:
Matthias Kretschmann 2020-09-11 16:34:13 +02:00
parent 32d637c203
commit 74a2c182e9
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 11 additions and 5 deletions

View File

@ -2,5 +2,6 @@
GATSBY_NETWORK="rinkeby" GATSBY_NETWORK="rinkeby"
#GATSBY_INFURA_PROJECT_ID="xxx" #GATSBY_INFURA_PROJECT_ID="xxx"
#GATSBY_METADATA_STORE_URI="xxx"
#GATSBY_MARKET_FEE_ADDRESS="0xxx" #GATSBY_MARKET_FEE_ADDRESS="0xxx"
#GATSBY_MARKET_FEE_AMOUNT="xxx" #GATSBY_MARKET_FEE_AMOUNT="xxx"

View File

@ -1,6 +1,7 @@
module.exports = { module.exports = {
network: process.env.GATSBY_NETWORK || 'rinkeby', network: process.env.GATSBY_NETWORK || 'rinkeby',
infuraProjectId: process.env.GATSBY_INFURA_PROJECT_ID || 'xxx', infuraProjectId: process.env.GATSBY_INFURA_PROJECT_ID || 'xxx',
metadataStoreUri: process.env.GATSBY_METADATA_STORE_URI,
marketFeeAddress: marketFeeAddress:
process.env.GATSBY_MARKET_FEE_ADDRESS || process.env.GATSBY_MARKET_FEE_ADDRESS ||
'0x903322C7E45A60d7c8C3EA236c5beA9Af86310c7', '0x903322C7E45A60d7c8C3EA236c5beA9Af86310c7',

View File

@ -24,13 +24,17 @@ export default function wrapRootElement({
}: { }: {
element: ReactElement element: ReactElement
}): ReactElement { }): ReactElement {
const oceanInitialConfig = getOceanConfig(appConfig.network) const { metadataStoreUri, network } = appConfig
const oceanInitialConfig = getOceanConfig(network)
const initialConfig = {
...oceanInitialConfig,
// add metadataStoreUri only when defined
...(metadataStoreUri && { metadataStoreUri })
}
return ( return (
<OceanProvider <OceanProvider initialConfig={initialConfig} web3ModalOpts={web3ModalOpts}>
initialConfig={oceanInitialConfig}
web3ModalOpts={web3ModalOpts}
>
<UserPreferencesProvider> <UserPreferencesProvider>
<NetworkMonitor /> <NetworkMonitor />
{element} {element}