From bcb125108db2f6439fcdd536f690b0edfd38aad7 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 7 Nov 2024 10:43:19 +0100 Subject: [PATCH] Introduce new localnet envs --- .env | 5 +++++ src/app/utils/route-utils.ts | 6 +++--- src/types/global.d.ts | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 575eac159..8f8169bab 100644 --- a/.env +++ b/.env @@ -30,3 +30,8 @@ REACT_APP_SHOW_BUILD_BANNERS=true # REACT_APP_FIXED_LAYER=sapphire # REACT_APP_SKIP_GRAPH=true REACT_APP_SHOW_FIAT_VALUES=true + +# LOCALNET SETTINGS +REACT_APP_LOCALNET_CONSENSUS=false +REACT_APP_LOCALNET_SAPPHIRE=false +REACT_APP_LOCALNET_EMERALD=false diff --git a/src/app/utils/route-utils.ts b/src/app/utils/route-utils.ts index adf85d0b3..90c26523b 100644 --- a/src/app/utils/route-utils.ts +++ b/src/app/utils/route-utils.ts @@ -93,12 +93,12 @@ export abstract class RouteUtils { [Layer.consensus]: !isStableDeploy, }, [Network.localnet]: { - [Layer.emerald]: false, - [Layer.sapphire]: true, + [Layer.emerald]: process.env.REACT_APP_LOCALNET_EMERALD === 'true', + [Layer.sapphire]: process.env.REACT_APP_LOCALNET_SAPPHIRE === 'true', [Layer.cipher]: false, [Layer.pontusxdev]: false, [Layer.pontusxtest]: false, - [Layer.consensus]: true, + [Layer.consensus]: process.env.REACT_APP_LOCALNET_CONSENSUS === 'true', }, } satisfies Record> diff --git a/src/types/global.d.ts b/src/types/global.d.ts index ce3fbc22b..f4892c1fe 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -30,6 +30,9 @@ declare global { REACT_APP_FIXED_LAYER?: string REACT_APP_SKIP_GRAPH?: string REACT_APP_SHOW_FIAT_VALUES: 'true' | 'false' + REACT_APP_LOCALNET_CONSENSUS: 'true' | 'false' + REACT_APP_LOCALNET_SAPPHIRE: 'true' | 'false' + REACT_APP_LOCALNET_EMERALD: 'true' | 'false' } }