From 33668d6abeb6539a620809ce57860043b88635a7 Mon Sep 17 00:00:00 2001 From: "taulant.disha" Date: Mon, 20 May 2024 22:53:23 +0300 Subject: [PATCH] added default chain id for connector --- src/AutWallet.tsx | 4 +++- src/api/environment.ts | 1 + src/pages/Nova/AutNovaTabs/Archetype/Archetype.tsx | 5 ++++- src/pages/Nova/AutNovaTabs/Archetype/ArchetypePieChart.tsx | 7 ++++--- src/pages/Nova/ToolbarConnector.tsx | 5 ++++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/AutWallet.tsx b/src/AutWallet.tsx index 8750f13..5603026 100644 --- a/src/AutWallet.tsx +++ b/src/AutWallet.tsx @@ -42,7 +42,9 @@ const AutWallet = () => { status, address, chainId - } = useAutConnector(); + } = useAutConnector({ + defaultChainId: +environment.defaultChainId + }); const novaAddress = useSelector(NovaAddress); const selectedRoleId = useSelector(SelectedRoleId); diff --git a/src/api/environment.ts b/src/api/environment.ts index 608bde2..a73b288 100644 --- a/src/api/environment.ts +++ b/src/api/environment.ts @@ -11,6 +11,7 @@ export const swEnvVariables = { graphApiUrl: "REACT_APP_GRAPH_API_URL", apiUrl: "REACT_APP_API_URL", networkEnv: "REACT_APP_NETWORK_ENV", + defaultChainId: "REACT_APP_DEFAULT_CHAIN_ID", // discord discordClientId: "REACT_APP_DISCORD_CLIENT_ID", diff --git a/src/pages/Nova/AutNovaTabs/Archetype/Archetype.tsx b/src/pages/Nova/AutNovaTabs/Archetype/Archetype.tsx index 4127bda..8869269 100644 --- a/src/pages/Nova/AutNovaTabs/Archetype/Archetype.tsx +++ b/src/pages/Nova/AutNovaTabs/Archetype/Archetype.tsx @@ -8,6 +8,7 @@ import { ArchetypeDialog } from "./ArchetypeDialog"; import AutSDK, { Nova } from "@aut-labs/sdk"; import ErrorDialog from "@components/Dialog/ErrorPopup"; import { ResponsiveContainer } from "recharts"; +import { environment } from "@api/environment"; const Archetypes = ({ nova }) => { const [isArchetypeOpen, setIsArchetypeOpen] = React.useState(false); @@ -16,7 +17,9 @@ const Archetypes = ({ nova }) => { setIsArchetypeOpen(false); }; - const { address } = useAutConnector(); + const { address } = useAutConnector({ + defaultChainId: +environment.defaultChainId + }); const { open } = useWalletConnector(); const isArchetypeSet = React.useMemo(() => { diff --git a/src/pages/Nova/AutNovaTabs/Archetype/ArchetypePieChart.tsx b/src/pages/Nova/AutNovaTabs/Archetype/ArchetypePieChart.tsx index c9bdd26..3962246 100644 --- a/src/pages/Nova/AutNovaTabs/Archetype/ArchetypePieChart.tsx +++ b/src/pages/Nova/AutNovaTabs/Archetype/ArchetypePieChart.tsx @@ -126,15 +126,16 @@ export const archetypeChartValues = (archetype: NovaArchetypeParameters) => { }; const CustomTooltip = ({ active, payload }) => { - console.log("CustomTooltip", active, payload); - const template = useMemo(() => { if (!active || !payload || !payload.length) return null; const { name, - payload: { description } + payload: { description, value } } = payload[0]; + + if (value < 40) return null; + return ( { - const { isConnected, disconnect } = useAutConnector(); + const { isConnected, disconnect } = useAutConnector({ + defaultChainId: +environment.defaultChainId + }); const { open } = useWalletConnector(); const navigate = useNavigate(); const dispatch = useAppDispatch();