Skip to content

Commit

Permalink
app: treat chainID as a number
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Licari committed Mar 7, 2024
1 parent de5881e commit b909011
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 (
<>
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/FaucetForm/Faucet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import HCaptcha from "@hcaptcha/react-hcaptcha"

interface FaucetProps {
enabledTokens: Token[],
chainId: string,
chainId: number,
setLoading: Dispatch<SetStateAction<boolean>>
}

Expand Down Expand Up @@ -151,7 +151,7 @@ function Faucet({ enabledTokens, chainId, setLoading }: FaucetProps): JSX.Elemen
<div className="flex-row success">
<div>Token sent to your wallet address. Hash: </div>
<div>
{chainId === "100"
{chainId === 100
? <a
target="_blank"
rel="noreferrer"
Expand Down

0 comments on commit b909011

Please sign in to comment.