Skip to content

Commit

Permalink
added default chain id for connector
Browse files Browse the repository at this point in the history
  • Loading branch information
taulant.disha authored and taulant.disha committed May 20, 2024
1 parent 8ba85c3 commit 33668d6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/AutWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const AutWallet = () => {
status,
address,
chainId
} = useAutConnector();
} = useAutConnector({
defaultChainId: +environment.defaultChainId
});

const novaAddress = useSelector(NovaAddress);
const selectedRoleId = useSelector(SelectedRoleId);
Expand Down
1 change: 1 addition & 0 deletions src/api/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Nova/AutNovaTabs/Archetype/Archetype.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(() => {
Expand Down
7 changes: 4 additions & 3 deletions src/pages/Nova/AutNovaTabs/Archetype/ArchetypePieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Box
sx={{
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Nova/ToolbarConnector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import { useAutConnector, useWalletConnector } from "@aut-labs/connector";
import { useNavigate } from "react-router-dom";
import { useAppDispatch } from "@store/store.model";
import { communityApi } from "@api/community.api";
import { environment } from "@api/environment";

export const TOOLBAR_HEIGHT = 84;

export const ToolbarConnector = () => {
const { isConnected, disconnect } = useAutConnector();
const { isConnected, disconnect } = useAutConnector({
defaultChainId: +environment.defaultChainId
});
const { open } = useWalletConnector();
const navigate = useNavigate();
const dispatch = useAppDispatch();
Expand Down

0 comments on commit 33668d6

Please sign in to comment.