diff --git a/custom.d.ts b/custom.d.ts index 44a1f9953..21aa2cdee 100644 --- a/custom.d.ts +++ b/custom.d.ts @@ -16,5 +16,6 @@ namespace NodeJS { NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: string; NEXT_PUBLIC_VPN_PROTECTION: string; NEXT_PUBLIC_DISABLE_SDAI_MARKET?: '1' | '0'; + NEXT_PUBLIC_ENABLE_GNOSIS?: '1' | '0'; } } diff --git a/src/components/MarketSwitcher.tsx b/src/components/MarketSwitcher.tsx index baa27a9f8..b6cbdd430 100644 --- a/src/components/MarketSwitcher.tsx +++ b/src/components/MarketSwitcher.tsx @@ -94,6 +94,8 @@ export const MarketSwitcher = () => { const upToLG = useMediaQuery(theme.breakpoints.up('lg')); const downToXSM = useMediaQuery(theme.breakpoints.down('xsm')); + if (process.env.NEXT_PUBLIC_ENABLE_GNOSIS !== '1') return null; + return ( { - acc[value] = _marketsData[value as keyof typeof CustomMarket]; - if ( - FORK_ENABLED && - _marketsData[value as keyof typeof CustomMarket].chainId === FORK_BASE_CHAIN_ID - ) { - acc[`fork_${value}`] = { - ..._marketsData[value as keyof typeof CustomMarket], - chainId: FORK_CHAIN_ID, - isFork: true, - }; - } - return acc; -}, {} as { [key: string]: MarketDataType }); +export const marketsData = Object.keys(_marketsData) + .filter((m) => m !== CustomMarket.gnosis || process.env.NEXT_PUBLIC_ENABLE_GNOSIS === '1') + .reduce((acc, value) => { + acc[value] = _marketsData[value as keyof typeof CustomMarket]; + if ( + FORK_ENABLED && + _marketsData[value as keyof typeof CustomMarket].chainId === FORK_BASE_CHAIN_ID + ) { + acc[`fork_${value}`] = { + ..._marketsData[value as keyof typeof CustomMarket], + chainId: FORK_CHAIN_ID, + isFork: true, + }; + } + return acc; + }, {} as { [key: string]: MarketDataType }); export function getDefaultChainId() { return marketsData[availableMarkets[0]].chainId;