Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrila committed Mar 18, 2024
1 parent 9e92b2a commit dacd439
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/components/ui/menus/AccountDisplay/MenuItemNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function MenuItemNetwork() {
cursor="pointer"
onChange={async e => {
e.preventDefault();
switchChain({chainId: Number(e.target.value)});
switchChain({ chainId: Number(e.target.value) });
}}
value={chainId}
>
Expand Down
17 changes: 10 additions & 7 deletions src/providers/NetworkConfig/web3-modal.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClient } from '@tanstack/react-query'
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config'
import { http } from 'wagmi';
import { QueryClient } from '@tanstack/react-query';
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config';
import { http } from 'wagmi';
import { hardhat, sepolia, mainnet, Chain } from 'wagmi/chains';
import { supportedChains } from './NetworkConfigProvider';

Expand All @@ -22,13 +22,16 @@ const wagmiMetadata = {
icons: [`${import.meta.env.VITE_APP_SITE_URL}favicon.icon`],
};


export const wagmiConfig = defaultWagmiConfig({
chains: supportedWagmiChains as [Chain, ...Chain[]],
projectId: walletConnectProjectId,
metadata: wagmiMetadata,
transports: {
[mainnet.id]: http(`https://eth-mainnet.g.alchemy.com/v2/${import.meta.env.VITE_APP_ALCHEMY_MAINNET_API_KEY}`),
[sepolia.id]: http(`https://eth-sepolia.g.alchemy.com/v2/${import.meta.env.VITE_APP_ALCHEMY_SEPOLIA_API_KEY}`)
}
[mainnet.id]: http(
`https://eth-mainnet.g.alchemy.com/v2/${import.meta.env.VITE_APP_ALCHEMY_MAINNET_API_KEY}`,
),
[sepolia.id]: http(
`https://eth-sepolia.g.alchemy.com/v2/${import.meta.env.VITE_APP_ALCHEMY_SEPOLIA_API_KEY}`,
),
},
});
36 changes: 20 additions & 16 deletions src/providers/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloProvider } from '@apollo/client';
import { ChakraProvider } from '@chakra-ui/react';
import { QueryClientProvider } from '@tanstack/react-query'
import { QueryClientProvider } from '@tanstack/react-query';
import { createWeb3Modal } from '@web3modal/wagmi/react';
import { ReactNode, useEffect } from 'react';
import { ToastContainer } from 'react-toastify';
Expand All @@ -12,7 +12,11 @@ import { FractalErrorBoundary, initErrorLogging } from '../helpers/errorLogging'
import { AppProvider } from './App/AppProvider';
import EthersContextProvider from './Ethers';
import { NetworkConfigProvider } from './NetworkConfig/NetworkConfigProvider';
import { wagmiConfig, walletConnectProjectId, queryClient } from './NetworkConfig/web3-modal.config';
import {
wagmiConfig,
walletConnectProjectId,
queryClient,
} from './NetworkConfig/web3-modal.config';

if (walletConnectProjectId) {
createWeb3Modal({ wagmiConfig, projectId: walletConnectProjectId });
Expand All @@ -31,20 +35,20 @@ export default function Providers({ children }: { children: ReactNode }) {
<FractalErrorBoundary fallback={<ErrorFallback />}>
<ApolloProvider client={graphQLClient}>
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<NetworkConfigProvider>
<EthersContextProvider>
<AppProvider>
<ToastContainer
position="bottom-center"
closeButton={false}
newestOnTop={false}
pauseOnFocusLoss={false}
/>
{children}
</AppProvider>
</EthersContextProvider>
</NetworkConfigProvider>
<QueryClientProvider client={queryClient}>
<NetworkConfigProvider>
<EthersContextProvider>
<AppProvider>
<ToastContainer
position="bottom-center"
closeButton={false}
newestOnTop={false}
pauseOnFocusLoss={false}
/>
{children}
</AppProvider>
</EthersContextProvider>
</NetworkConfigProvider>
</QueryClientProvider>
</WagmiProvider>
</ApolloProvider>
Expand Down

0 comments on commit dacd439

Please sign in to comment.