From 9c588ba0bec51e135b8253c54666b2052942e465 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Thu, 7 Mar 2024 15:44:45 +0100 Subject: [PATCH] app: treat chainID as a number --- app/src/App.tsx | 8 ++++---- app/src/components/FaucetForm/Faucet.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/App.tsx b/app/src/App.tsx index b304c06..f2c2305 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -8,12 +8,12 @@ import Loading from "./components/Loading/Loading" import Faucet from "./components/FaucetForm/Faucet" const chainName:{ [key: string]: string }= { - "100": "Gnosis", - "10200": "Chiado" + 100: "Gnosis", + 10200: "Chiado" } function App(): JSX.Element { - const [chainId, setChainId] = useState("10200") + const [chainId, setChainId] = useState(10200) const [loading, setLoading] = useState(true) const [enabledTokens, setEnabledTokens] = useState([]) const [faucetLoading, setFaucetLoading] = useState(true) @@ -44,7 +44,7 @@ function App(): JSX.Element { const title = faucetLoading ? "FAUCET" : `${chainName[chainId]} CHAIN` const subtitle = faucetLoading ? "Loading..." - : (chainId === "100" ? "Faucet" : "Testnet Faucet") + : (chainId === 100 ? "Faucet" : "Testnet Faucet") return ( <> diff --git a/app/src/components/FaucetForm/Faucet.tsx b/app/src/components/FaucetForm/Faucet.tsx index 447a39f..a3297af 100644 --- a/app/src/components/FaucetForm/Faucet.tsx +++ b/app/src/components/FaucetForm/Faucet.tsx @@ -8,7 +8,7 @@ import HCaptcha from "@hcaptcha/react-hcaptcha" interface FaucetProps { enabledTokens: Token[], - chainId: string, + chainId: number, setLoading: Dispatch> }