From 1b734b85b76d2d3fa671ed42660a5ebc59ed15d0 Mon Sep 17 00:00:00 2001 From: Iris Date: Mon, 28 Aug 2023 09:28:45 +0200 Subject: [PATCH] fix: testing without double render --- components/UI/wallets.tsx | 41 +++++++++++++-------------------------- next.config.js | 2 +- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/components/UI/wallets.tsx b/components/UI/wallets.tsx index 66546cd7..1a782157 100644 --- a/components/UI/wallets.tsx +++ b/components/UI/wallets.tsx @@ -1,6 +1,6 @@ import React from "react"; import styles from "../../styles/components/wallets.module.css"; -import { Connector, useAccount, useConnectors } from "@starknet-react/core"; +import { useAccount, useConnectors } from "@starknet-react/core"; import Button from "./button"; import { FunctionComponent, useEffect } from "react"; import { Modal } from "@mui/material"; @@ -24,21 +24,6 @@ const Wallets: FunctionComponent = ({ } }, [account, closeWallet]); - function connectWallet(connector: Connector) { - try { - connect(connector); - } finally { - if (!connector.available() && !account) { - if (connector.id === "argentX") - window.open("https://www.argent.xyz/argent-x/"); - else if (connector.id === "braavos") - window.open("https://braavos.app/download-braavos-wallet/"); - } else { - closeWallet(); - } - } - } - return ( = ({

You need a Starknet wallet

{connectors.map((connector) => { - // if (connector.available()) { - return ( -
- -
- ); - // } + if (connector.available()) { + return ( +
+ +
+ ); + } })}
diff --git a/next.config.js b/next.config.js index 9b8aa104..31f5ea51 100644 --- a/next.config.js +++ b/next.config.js @@ -29,7 +29,7 @@ module.exports = { ], }; }, - reactStrictMode: true, + reactStrictMode: false, webpack: (config, { isServer }) => { if (!isServer) { config.resolve.fallback.fs = false;