diff --git a/package-lock.json b/package-lock.json index e103d5a..f654d79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dao-v2-ui", - "version": "0.1.0", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dao-v2-ui", - "version": "0.1.0", + "version": "1.0.0", "hasInstallScript": true, "dependencies": { "@rainbow-me/rainbowkit": "^0.12.18", @@ -64,9 +64,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", - "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==" + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.2.tgz", + "integrity": "sha512-DA5a1C0gD/pLOvhv33YMrbf2FK3oUzwNl9oOJqE4XVjuEtt6XIakRcsd7eLiOSPkp1kTRQGICTA8cKra/vFbjw==" }, "node_modules/@ampproject/remapping": { "version": "2.2.0", @@ -7309,8 +7309,9 @@ } }, "node_modules/axios": { - "version": "1.3.4", - "license": "MIT", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -21719,9 +21720,9 @@ }, "dependencies": { "@adobe/css-tools": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", - "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==" + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.2.tgz", + "integrity": "sha512-DA5a1C0gD/pLOvhv33YMrbf2FK3oUzwNl9oOJqE4XVjuEtt6XIakRcsd7eLiOSPkp1kTRQGICTA8cKra/vFbjw==" }, "@ampproject/remapping": { "version": "2.2.0", @@ -26488,7 +26489,9 @@ "version": "4.6.3" }, "axios": { - "version": "1.3.4", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 29ad94c..4ad4dc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-v2-ui", - "version": "0.1.0", + "version": "1.0.0", "private": true, "homepage": ".", "dependencies": { diff --git a/src/components/App.jsx b/src/components/App.jsx index 6a44dd5..5e6e797 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -3,7 +3,7 @@ import { ThemeContext } from 'styled-components' import { createHashRouter, RouterProvider } from 'react-router-dom' import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit' import { configureChains, createClient, WagmiConfig, createStorage } from 'wagmi' -import { mainnet, polygon, bsc } from 'wagmi/chains' +import { polygon } from 'wagmi/chains' import { jsonRpcProvider } from '@wagmi/core/providers/jsonRpc' import { getWeb3Settings } from 'react-web3-settings' @@ -43,23 +43,15 @@ const router = createHashRouter([ const settings = getWeb3Settings() const { chains, provider } = configureChains( - [mainnet, polygon, bsc], + [polygon], [ jsonRpcProvider({ rpc: (chain) => ({ http: - chain.id === mainnet.id - ? settings.rpcEndpoints && settings.rpcEndpoints[0] !== '' - ? settings.rpcEndpoints[0] - : `https://eth-mainnet.alchemyapi.io/v2/${process.env.REACT_APP_ALCHEMY_ID}` - : chain.id === polygon.id + chain.id === polygon.id ? settings.rpcEndpoints && settings.rpcEndpoints[1] !== '' ? settings.rpcEndpoints[1] : `https://polygon-mainnet.alchemyapi.io/v2/${process.env.REACT_APP_ALCHEMY_ID}` - : chain.id === bsc.id - ? settings.rpcEndpoints && settings.rpcEndpoints[2] !== '' - ? settings.rpcEndpoints[2] - : `https://bsc-mainnet.alchemyapi.io/v2/${process.env.REACT_APP_ALCHEMY_ID}` : 'Unsupported Chain' }) }) diff --git a/src/components/complex/ChainModal/index.jsx b/src/components/complex/ChainModal/index.jsx index c48674d..bd2dca6 100644 --- a/src/components/complex/ChainModal/index.jsx +++ b/src/components/complex/ChainModal/index.jsx @@ -1,6 +1,6 @@ import { Fragment, useState, useEffect, useCallback } from 'react' import { Row, Col } from 'react-bootstrap' -import { useChainId, useSwitchNetwork, useAccount } from 'wagmi' +import { useNetwork, useSwitchNetwork, useAccount } from 'wagmi' import { polygon } from 'wagmi/chains' import styled from 'styled-components' import { FaInfoCircle } from 'react-icons/fa' @@ -49,7 +49,7 @@ const StyledFaInfoCircle = styled(FaInfoCircle)` ` const ChainModal = ({ show, onClose }) => { - const activeChainId = useChainId() + const activeNetwork = useNetwork() const { chains, error: networkError, switchNetwork } = useSwitchNetwork() const { connector: activeConnector } = useAccount() const [switchingToChain, setSwitchingToChain] = useState(false) @@ -91,7 +91,7 @@ const ChainModal = ({ show, onClose }) => {
{switchNetwork ? ( chains.map((_chain) => { - const isCurrentChain = _chain.id === activeChainId + const isCurrentChain = _chain.id === activeNetwork.chain.id const switching = _chain.id === switchingToChain return ( @@ -118,8 +118,7 @@ const ChainModal = ({ show, onClose }) => {
diff --git a/src/components/complex/Header/index.jsx b/src/components/complex/Header/index.jsx index f2202f7..0e4fd1f 100644 --- a/src/components/complex/Header/index.jsx +++ b/src/components/complex/Header/index.jsx @@ -191,7 +191,7 @@ const CustomConnectButton = () => { if (chain.unsupported) { return ( ) }