diff --git a/.env.example b/.env.example index 7a07fae82..35bfb7519 100644 --- a/.env.example +++ b/.env.example @@ -2,5 +2,6 @@ GATSBY_NETWORK="rinkeby" #GATSBY_INFURA_PROJECT_ID="xxx" +#GATSBY_METADATA_STORE_URI="xxx" #GATSBY_MARKET_FEE_ADDRESS="0xxx" #GATSBY_MARKET_FEE_AMOUNT="xxx" \ No newline at end of file diff --git a/app.config.js b/app.config.js index 19724cd17..f52f49c91 100644 --- a/app.config.js +++ b/app.config.js @@ -1,6 +1,7 @@ module.exports = { network: process.env.GATSBY_NETWORK || 'rinkeby', infuraProjectId: process.env.GATSBY_INFURA_PROJECT_ID || 'xxx', + metadataStoreUri: process.env.GATSBY_METADATA_STORE_URI, marketFeeAddress: process.env.GATSBY_MARKET_FEE_ADDRESS || '0x903322C7E45A60d7c8C3EA236c5beA9Af86310c7', diff --git a/src/helpers/wrapRootElement.tsx b/src/helpers/wrapRootElement.tsx index 5000ccb90..857b1f96d 100644 --- a/src/helpers/wrapRootElement.tsx +++ b/src/helpers/wrapRootElement.tsx @@ -24,13 +24,17 @@ export default function wrapRootElement({ }: { element: 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 ( - + {element}