From d31f3378b5a4d72479b73b57193b75c010cd8e76 Mon Sep 17 00:00:00 2001 From: jdrskr Date: Thu, 30 Nov 2023 12:17:55 +0100 Subject: [PATCH] feat: update swap address --- .github/workflows/build-and-publish-frontend.yml | 2 +- frontend/src/constants/LocalStorage.ts | 2 +- frontend/src/pages/account/pages/LoginPage.tsx | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish-frontend.yml b/.github/workflows/build-and-publish-frontend.yml index 3a14f90..f7141a6 100644 --- a/.github/workflows/build-and-publish-frontend.yml +++ b/.github/workflows/build-and-publish-frontend.yml @@ -35,7 +35,7 @@ jobs: REACT_APP_TOKEN_LFT_ADDRESS: "0xD73464667d5F2e15dd0A3C58C3610c39c1b1c2d4" REACT_APP_TOKEN_LFN_ADDRESS: "0x0d9D5372b5F889bCEcb930b1540f7D1595075177" REACT_APP_TOKEN_NTN_ADDRESS: "0x9019337Ecc929a777B9f87c91D28713496Fc6381" - REACT_APP_SWAP_CONTRACT_ADDRESS: "0x0C47bb35e40AE5C7e22bCf9088641b610D9aD4C6" + REACT_APP_SWAP_CONTRACT_ADDRESS: "0xA3C07d96e1e81c415FAa8763fa57299415c08228" REACT_APP_STABLE_ADDRESS: "0xb1E34471421DEACda61e68897ED6DBE373169eE9" - uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/frontend/src/constants/LocalStorage.ts b/frontend/src/constants/LocalStorage.ts index 8a43392..3d57d4c 100644 --- a/frontend/src/constants/LocalStorage.ts +++ b/frontend/src/constants/LocalStorage.ts @@ -1,3 +1,3 @@ export const LocalStorage = { - AuthToken: 'Auth.Token', + AuthToken: 'Auth.Token' } diff --git a/frontend/src/pages/account/pages/LoginPage.tsx b/frontend/src/pages/account/pages/LoginPage.tsx index 70ffedf..69b8575 100644 --- a/frontend/src/pages/account/pages/LoginPage.tsx +++ b/frontend/src/pages/account/pages/LoginPage.tsx @@ -6,6 +6,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { Box, Button, TextField, Typography } from "@mui/material"; import { useApiContext } from "../../../context/ApiContext"; import { useAuthContext } from "../../../context/AuthContext"; +import { useNavigate } from "react-router-dom"; const Schema = z.object({ login: z.string().nonempty("The comment is required!"), @@ -15,6 +16,8 @@ const Schema = z.object({ type SchemaType = z.infer; export const LoginPage: React.FC = () => { + const navigate = useNavigate(); + const { client } = useApiContext(); const { authenticate } = useAuthContext(); const snackbar = useSnackbar(); @@ -34,6 +37,12 @@ export const LoginPage: React.FC = () => { authenticate(accessToken, userId, isAdmin); + if (isAdmin) { + navigate("/admin/orders"); + } else { + navigate("/client/issue"); + } + snackbar.enqueueSnackbar("Login success", { variant: "success", });