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", "usehooks-ts": "^2.15.1",
"uuid": "^9.0.1", "uuid": "^9.0.1",
"viem": "^2.7.11", "viem": "^2.7.11",
"wagmi": "^2.5.7",
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },
"devDependencies": { "devDependencies": {

View File

@ -3,8 +3,6 @@ import { NavLink, useNavigate, useParams } from 'react-router-dom';
import { Organization, User } from 'gql-client'; import { Organization, User } from 'gql-client';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { useDisconnect } from 'wagmi';
import { useGQLClient } from 'context/GQLClientContext'; import { useGQLClient } from 'context/GQLClientContext';
import { import {
GlobeIcon, GlobeIcon,
@ -31,7 +29,6 @@ export const Sidebar = ({ mobileOpen }: SidebarProps) => {
const { orgSlug } = useParams(); const { orgSlug } = useParams();
const navigate = useNavigate(); const navigate = useNavigate();
const client = useGQLClient(); const client = useGQLClient();
const { disconnect } = useDisconnect();
const isDesktop = useMediaQuery('(min-width: 960px)'); const isDesktop = useMediaQuery('(min-width: 960px)');
const [user, setUser] = useState<User>(); const [user, setUser] = useState<User>();
@ -90,10 +87,9 @@ export const Sidebar = ({ mobileOpen }: SidebarProps) => {
method: 'POST', method: 'POST',
credentials: 'include', credentials: 'include',
}); });
disconnect();
localStorage.clear(); localStorage.clear();
navigate('/login'); navigate('/login');
}, [disconnect, navigate]); }, [navigate]);
return ( return (
<motion.nav <motion.nav

View File

@ -1,36 +1,14 @@
import { ReactNode } from 'react'; 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'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
const queryClient = new QueryClient(); 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) { if (!import.meta.env.VITE_WALLET_CONNECT_ID) {
throw new Error('Error: REACT_APP_WALLET_CONNECT_ID env config is not set'); throw new Error('Error: REACT_APP_WALLET_CONNECT_ID env config is not set');
} }
export default function Web3Provider({ children }: { children: ReactNode }) { export default function Web3Provider({ children }: { children: ReactNode }) {
return ( return (
<WagmiProvider config={config}> <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
</WagmiProvider>
); );
} }

1430
yarn.lock

File diff suppressed because it is too large Load Diff