Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
malerba118 committed Feb 14, 2022
1 parent 622e46e commit f02a505
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import { QueryClient, QueryClientProvider } from "react-query";
import { ChakraProvider, Box, Heading } from "@chakra-ui/react";
import { Toaster } from "react-hot-toast";
import theme from "../theme";
import { Provider as WagmiProvider, InjectedConnector, chain } from "wagmi";
import { Provider as WagmiProvider } from "wagmi";
import { providers } from "ethers";

// Chains for connectors to support
const chains = [chain.polygonTestnetMumbai, chain.hardhat];

// Provide a fallback network while chainId is not yet defined
const provider = ({ chainId, connector }) => {
const selectedChain = connector?.chains.find((c) => c.id === chainId);
Expand All @@ -18,16 +15,7 @@ const provider = ({ chainId, connector }) => {
);
};

// Enables sign-in with Metamask
const connectors = () => {
return [
new InjectedConnector({
chains,
}),
];
};

// Create a client
// Create a react-query client
const queryClient = new QueryClient({
defaultOptions: {
queries: {
Expand All @@ -38,7 +26,7 @@ const queryClient = new QueryClient({

const App: NextPage = () => {
return (
<WagmiProvider autoConnect provider={provider} connectors={connectors}>
<WagmiProvider autoConnect provider={provider}>
<ChakraProvider theme={theme}>
<QueryClientProvider client={queryClient}>
<Box p={8} maxW="600px" minW="320px" m="0 auto">
Expand Down

0 comments on commit f02a505

Please sign in to comment.