Skip to content

Commit

Permalink
Add REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR enviroment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniSomoza authored and Uxio0 committed Jan 26, 2023
1 parent 2ff8002 commit a984c8e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
7 changes: 6 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
REACT_APP_CONFIG_SERVICE_URL=https://safe-config.safe.global

# 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
22 changes: 16 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(
Expand All @@ -24,12 +25,18 @@ function App() {
{/* App header */}
<Header isDarkTheme={isDarkTheme} switchThemeMode={switchThemeMode} />

<Container maxWidth="lg" component="main" sx={{ marginBottom: "32px" }}>
<Container
maxWidth="lg"
component="main"
sx={{ marginBottom: "36px", marginTop: "42px" }}
>
{/* Config service selector */}
<ConfigServiceUrlSelector
configServiceUrl={configServiceUrl}
setConfigServiceUrl={setConfigServiceUrl}
/>
{showConfigServiceSelector && (
<ConfigServiceUrlSelector
configServiceUrl={configServiceUrl}
setConfigServiceUrl={setConfigServiceUrl}
/>
)}

{/* Chain status table */}
<ChainStatusTable configServiceUrl={configServiceUrl} />
Expand All @@ -39,3 +46,6 @@ function App() {
}

export default App;

const showConfigServiceSelector =
REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR === "true";

0 comments on commit a984c8e

Please sign in to comment.