diff --git a/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx b/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx index b61b1fee..bcd44611 100644 --- a/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx +++ b/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useEffect, useState } from 'react'; import { NavLink, useNavigate, useParams } from 'react-router-dom'; -import { Organization } from 'gql-client'; +import { Organization, User } from 'gql-client'; import { Option } from '@material-tailwind/react'; import { useDisconnect } from 'wagmi'; @@ -12,11 +12,16 @@ import { FolderIcon, GlobeIcon, LifeBuoyIcon, + LogoutIcon, QuestionMarkRoundIcon, SettingsSlidersIcon, } from 'components/shared/CustomIcon'; import { Tabs } from 'components/shared/Tabs'; import { Logo } from 'components/Logo'; +import { Avatar } from 'components/shared/Avatar'; +import { formatAddress } from 'utils/format'; +import { getInitials } from 'utils/geInitials'; +import { Button } from 'components/shared/Button'; export const Sidebar = () => { const { orgSlug } = useParams(); @@ -24,6 +29,17 @@ export const Sidebar = () => { const client = useGQLClient(); const { disconnect } = useDisconnect(); + const [user, setUser] = useState(); + + const fetchUser = useCallback(async () => { + const { user } = await client.getUser(); + setUser(user); + }, []); + + useEffect(() => { + fetchUser(); + }, []); + const [selectedOrgSlug, setSelectedOrgSlug] = useState(orgSlug); const [organizations, setOrganizations] = useState([]); @@ -43,39 +59,21 @@ export const Sidebar = () => { }, [disconnect, navigate]); return ( -