Browse Source

fixed highlighting

imwald
Silberengel 5 months ago
parent
commit
5ebe9eb9ab
  1. 9
      src/components/Sidebar/ProfileButton.tsx

9
src/components/Sidebar/ProfileButton.tsx

@ -8,11 +8,18 @@ export default function ProfileButton() {
const { primaryViewType } = usePrimaryNoteView() const { primaryViewType } = usePrimaryNoteView()
const { checkLogin } = useNostr() const { checkLogin } = useNostr()
// Profile button is active when:
// 1. Profile is the current primary page AND there's no overlay (primaryViewType === null)
// 2. OR primaryViewType is 'profile' (overlay profile)
const isActive =
(display && current === 'profile' && primaryViewType === null) ||
primaryViewType === 'profile'
return ( return (
<SidebarItem <SidebarItem
title="Profile" title="Profile"
onClick={() => checkLogin(() => navigate('profile'))} onClick={() => checkLogin(() => navigate('profile'))}
active={display && current === 'profile' && primaryViewType === 'profile'} active={isActive}
> >
<UserRound strokeWidth={3} /> <UserRound strokeWidth={3} />
</SidebarItem> </SidebarItem>

Loading…
Cancel
Save