This commit is contained in:
Gilbert 2024-05-02 15:50:20 -05:00
parent 56a264199b
commit 3ffac1a019
4 changed files with 58 additions and 1403 deletions

View File

@ -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": {

View File

@ -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

View File

@ -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>
);
}

1430
yarn.lock

File diff suppressed because it is too large Load Diff