From 73200e192ccd9d74d426fd52b42d6da9de826c91 Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Mon, 13 Mar 2023 12:24:00 +0000 Subject: [PATCH] allow arbitrum UI --- .env.local | 3 ++- next.config.js | 3 ++- package.json | 2 +- src/components/KillSwitch.tsx | 17 ++++++++++++++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.env.local b/.env.local index 3394fa83a..474fb7516 100644 --- a/.env.local +++ b/.env.local @@ -1,4 +1,4 @@ -REACT_APP_DEFAULT_CHAINID=1 +REACT_APP_DEFAULT_CHAINID=42161 REACT_APP_VERSION=$npm_package_version REACT_APP_RPC_URL_1='https://eth-mainnet.g.alchemy.com/v2/ZXDCq5iy0KrKR0XjsqC6E4QG7Z_FuXDv' @@ -26,4 +26,5 @@ ALCHEMY_MAINNET_KEY=ZXDCq5iy0KrKR0XjsqC6E4QG7Z_FuXDv GENERATE_SOURCEMAP=false KILLSWITCH_ACTIVE=true +KILLSWITCH_CHAIN=1 KILLSWITCH_TEXT='Due to an Euler Finance security incident, we are suspending UI interaction with the Yield Protocol until we have fully assessed the implications of the breach' \ No newline at end of file diff --git a/next.config.js b/next.config.js index a00d5d9c8..a94cfa8a5 100644 --- a/next.config.js +++ b/next.config.js @@ -18,7 +18,8 @@ const nextConfig = { ENV: process.env.NODE_ENV, KILLSWITCH_ACTIVE: process.env.KILLSWITCH_ACTIVE, - KILLSWITCH_TEXT: process.env.KILLSWITCH_TEXT + KILLSWITCH_TEXT: process.env.KILLSWITCH_TEXT, + KILLSWITCH_CHAIN: process.env.KILLSWITCH_CHAIN, }, async redirects() { return [ diff --git a/package.json b/package.json index 022b82ccc..19697262a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app-v2", - "version": "2.5.8", + "version": "2.5.9", "private": true, "dependencies": { "@ethersproject/providers": "^5.6.8", diff --git a/src/components/KillSwitch.tsx b/src/components/KillSwitch.tsx index 763455b42..de7c36232 100644 --- a/src/components/KillSwitch.tsx +++ b/src/components/KillSwitch.tsx @@ -1,12 +1,17 @@ import { Box, Layer, Text } from 'grommet'; import React from 'react'; import { FiAlertCircle } from 'react-icons/fi'; +import { useChain } from '../hooks/useChain'; +import useChainId from '../hooks/useChainId'; /* A kill switch is a way to disable the entire app. It is set in the .env file. ( AND next.config.js ) */ const KillSwitch = (props: any) => { + + const chainId = useChainId(); + return ( <> - {process.env.KILLSWITCH_ACTIVE === 'true' ? ( + { ( process.env.KILLSWITCH_ACTIVE === 'true' && chainId === parseInt(process.env.KILLSWITCH_CHAIN!) ) ? ( @@ -21,6 +26,16 @@ const KillSwitch = (props: any) => { {process.env.KILLSWITCH_TEXT} + + + + Affects Chain: + + + {parseInt(process.env.KILLSWITCH_CHAIN!) === 1 ? 'Ethereum Mainnet' : 'Arbitrum One' } + + + ) : (