From ab878ba9a6afaa57805aeab988b01c5b47bc9286 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 9 Nov 2023 20:35:17 -0600 Subject: Web login/signup and shell --- src/view/shell/desktop/LeftNav.tsx | 63 ++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 26 deletions(-) (limited to 'src/view/shell/desktop/LeftNav.tsx') diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index b85823b6f..3a0c0c95d 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -41,18 +41,31 @@ import {router} from '../../../routes' import {makeProfileLink} from 'lib/routes/links' import {useLingui} from '@lingui/react' import {Trans, msg} from '@lingui/macro' +import {useGetProfile} from '#/data/useGetProfile' +import {useSession} from '#/state/session' const ProfileCard = observer(function ProfileCardImpl() { - const store = useStores() + const {currentAccount} = useSession() + const { + isLoading, + isError, + data: profile, + } = useGetProfile({did: currentAccount!.did}) const {isDesktop} = useWebMediaQueries() const size = 48 - return store.me.handle ? ( + + if (isError || !profile || !currentAccount) return null + + return !isLoading ? ( - + ) : ( @@ -255,7 +268,7 @@ export const DesktopLeftNav = observer(function DesktopLeftNav() { pal.view, pal.border, ]}> - {store.session.hasSession && } + - {store.session.hasSession && ( - - } - iconFilled={ - - } - label="Profile" - /> - )} + + } + iconFilled={ + + } + label="Profile" + /> - {store.session.hasSession && } + ) }) -- cgit 1.4.1