From a984c8e554f736f776f4b74f6ff603a9a145a624 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Thu, 26 Jan 2023 13:23:17 +0100 Subject: [PATCH] Add REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR enviroment variable --- example.env | 7 ++++++- src/App.tsx | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/example.env b/example.env index b9e1436..6d0994e 100644 --- a/example.env +++ b/example.env @@ -1 +1,6 @@ -REACT_APP_CONFIG_SERVICE_URL=https://safe-config.safe.global \ No newline at end of file + +# Config service url +REACT_APP_CONFIG_SERVICE_URL=https://safe-config.safe.global + +# Shows the Config service url selector if true +REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR=true diff --git a/src/App.tsx b/src/App.tsx index 1522557..313ac55 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,8 @@ import Header from "src/components/header/Header"; import ConfigServiceUrlSelector from "src/components/config-service-url-selector/ConfigServiceUrlSelector"; import ChainStatusTable from "src/components/chain-status-table/ChainStatusTable"; -const { REACT_APP_CONFIG_SERVICE_URL } = process.env; +const { REACT_APP_CONFIG_SERVICE_URL, REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR } = + process.env; function App() { const [configServiceUrl, setConfigServiceUrl] = useState( @@ -24,12 +25,18 @@ function App() { {/* App header */}
- + {/* Config service selector */} - + {showConfigServiceSelector && ( + + )} {/* Chain status table */} @@ -39,3 +46,6 @@ function App() { } export default App; + +const showConfigServiceSelector = + REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR === "true";