From b909011fac942d0151cff1d11410349d9d5aad5f Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Thu, 7 Mar 2024 15:44:45 +0100 Subject: [PATCH 1/2] app: treat chainID as a number --- app/src/App.tsx | 8 ++++---- app/src/components/FaucetForm/Faucet.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 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..c09f175 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> } @@ -151,7 +151,7 @@ function Faucet({ enabledTokens, chainId, setLoading }: FaucetProps): JSX.Elemen
Token sent to your wallet address. Hash:
- {chainId === "100" + {chainId === 100 ? Date: Thu, 7 Mar 2024 16:16:14 +0100 Subject: [PATCH 2/2] CI: add steps to build UI for Chiado and GC --- .github/workflows/publish-ui.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-ui.yaml b/.github/workflows/publish-ui.yaml index 0122754..c313cb3 100644 --- a/.github/workflows/publish-ui.yaml +++ b/.github/workflows/publish-ui.yaml @@ -58,17 +58,29 @@ jobs: "REACT_APP_HCAPTCHA_SITE_KEY=${{ secrets.DEV_REACT_APP_HCAPTCHA_SITE_KEY }}" "REACT_APP_FAUCET_API_URL=${{ secrets.DEV_REACT_APP_FAUCET_API_URL}}" - - name: Main branch / tags - Build and push Docker image + - name: Gnosis Chain - Main branch / tags - Build and push Docker image if: ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 with: context: app push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }}-gc + labels: ${{ steps.meta.outputs.labels }} + build-args: | + "REACT_APP_HCAPTCHA_SITE_KEY=${{ secrets.PROD_GC_REACT_APP_HCAPTCHA_SITE_KEY }}" + "REACT_APP_FAUCET_API_URL=${{ secrets.PROD_GC_REACT_APP_FAUCET_API_URL}}" + + - name: Chiado Chain - Main branch / tags - Build and push Docker image + if: ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) + uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 + with: + context: app + push: true + tags: ${{ steps.meta.outputs.tags }}-chiado labels: ${{ steps.meta.outputs.labels }} build-args: | - "REACT_APP_HCAPTCHA_SITE_KEY=${{ secrets.PROD_REACT_APP_HCAPTCHA_SITE_KEY }}" - "REACT_APP_FAUCET_API_URL=${{ secrets.PROD_REACT_APP_FAUCET_API_URL}}" + "REACT_APP_HCAPTCHA_SITE_KEY=${{ secrets.PROD_CHIADO_REACT_APP_HCAPTCHA_SITE_KEY }}" + "REACT_APP_FAUCET_API_URL=${{ secrets.PROD_CHIADO_REACT_APP_FAUCET_API_URL}}" eks-deployment-restart: # Run job on branch dev only