forked from cerc-io/snowballtools-base
ngmi
This commit is contained in:
parent
56a264199b
commit
3ffac1a019
@ -65,7 +65,6 @@
|
||||
"usehooks-ts": "^2.15.1",
|
||||
"uuid": "^9.0.1",
|
||||
"viem": "^2.7.11",
|
||||
"wagmi": "^2.5.7",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -3,8 +3,6 @@ import { NavLink, useNavigate, useParams } from 'react-router-dom';
|
||||
import { Organization, User } from 'gql-client';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
import { useDisconnect } from 'wagmi';
|
||||
|
||||
import { useGQLClient } from 'context/GQLClientContext';
|
||||
import {
|
||||
GlobeIcon,
|
||||
@ -31,7 +29,6 @@ export const Sidebar = ({ mobileOpen }: SidebarProps) => {
|
||||
const { orgSlug } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const client = useGQLClient();
|
||||
const { disconnect } = useDisconnect();
|
||||
const isDesktop = useMediaQuery('(min-width: 960px)');
|
||||
|
||||
const [user, setUser] = useState<User>();
|
||||
@ -90,10 +87,9 @@ export const Sidebar = ({ mobileOpen }: SidebarProps) => {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
});
|
||||
disconnect();
|
||||
localStorage.clear();
|
||||
navigate('/login');
|
||||
}, [disconnect, navigate]);
|
||||
}, [navigate]);
|
||||
|
||||
return (
|
||||
<motion.nav
|
||||
|
@ -1,36 +1,14 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { WagmiProvider } from 'wagmi';
|
||||
import { arbitrum, mainnet } from 'wagmi/chains';
|
||||
|
||||
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
const metadata = {
|
||||
name: 'Snowball Tools',
|
||||
description: 'Snowball Tools Dashboard',
|
||||
url: window.location.origin,
|
||||
icons: [
|
||||
'https://raw.githubusercontent.com/snowball-tools/mediakit/main/assets/logo.svg',
|
||||
],
|
||||
};
|
||||
|
||||
const chains = [mainnet, arbitrum] as const;
|
||||
const config = defaultWagmiConfig({
|
||||
chains,
|
||||
projectId: import.meta.env.VITE_WALLET_CONNECT_ID,
|
||||
metadata,
|
||||
});
|
||||
|
||||
if (!import.meta.env.VITE_WALLET_CONNECT_ID) {
|
||||
throw new Error('Error: REACT_APP_WALLET_CONNECT_ID env config is not set');
|
||||
}
|
||||
|
||||
export default function Web3Provider({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<WagmiProvider config={config}>
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
</WagmiProvider>
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user