Skip to content

Commit

Permalink
add rainbowkit
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Sep 9, 2024
1 parent d3ab5c3 commit 961a0b4
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 9 deletions.
2 changes: 2 additions & 0 deletions packages/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dependencies": {
"@hookform/resolvers": "^3.9.0",
"@latticexyz/common": "workspace:*",
"@latticexyz/config": "workspace:*",
"@latticexyz/protocol-parser": "workspace:*",
"@latticexyz/schema-type": "workspace:*",
"@latticexyz/store": "workspace:*",
Expand All @@ -37,6 +38,7 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/themes": "^3.0.5",
"@rainbow-me/rainbowkit": "^2.1.5",
"@tanstack/react-query": "^5.51.3",
"@tanstack/react-table": "^8.19.3",
"@wagmi/core": "^2.12.1",
Expand Down
16 changes: 10 additions & 6 deletions packages/explorer/src/app/(explorer)/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
"use client";

import { WagmiProvider } from "wagmi";
import { WagmiProvider, createConfig, http } from "wagmi";
import { injected, metaMask, safe } from "wagmi/connectors";
import { ReactNode } from "react";
import { RainbowKitProvider, darkTheme } from "@rainbow-me/rainbowkit";
import "@rainbow-me/rainbowkit/styles.css";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createConfig, http } from "@wagmi/core";
import { localhost } from "@wagmi/core/chains";
import { anvil } from "@wagmi/core/chains";
import { AppStoreProvider } from "../../store";

const queryClient = new QueryClient();

export const wagmiConfig = createConfig({
chains: [localhost],
chains: [anvil],
connectors: [
injected(),
metaMask({
Expand All @@ -22,15 +23,18 @@ export const wagmiConfig = createConfig({
safe(),
],
transports: {
[localhost.id]: http(),
[anvil.id]: http(),
},
ssr: true,
});

export function Providers({ children }: { children: ReactNode }) {
return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<AppStoreProvider>{children}</AppStoreProvider>
<RainbowKitProvider theme={darkTheme()}>
<AppStoreProvider>{children}</AppStoreProvider>
</RainbowKitProvider>
</QueryClientProvider>
</WagmiProvider>
);
Expand Down
121 changes: 118 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 961a0b4

Please sign in to comment.