fix: pass onOpenOrgSettings to UserMenu — no more page navigation for org settings

This commit is contained in:
Usman Baig
2026-03-26 11:26:38 +01:00
parent c99278e7fa
commit ee1196f061

View File

@@ -379,12 +379,13 @@ interface SidebarContentProps {
orgs: OrganizationMember[] orgs: OrganizationMember[]
onSwitchOrganization: (orgId: string | null) => Promise<void> onSwitchOrganization: (orgId: string | null) => Promise<void>
openSettings: () => void openSettings: () => void
openOrgSettings: () => void
} }
function SidebarContent({ function SidebarContent({
isMobile, collapsed, siteId, sites, canEdit, pendingHref, isMobile, collapsed, siteId, sites, canEdit, pendingHref,
onNavigate, onMobileClose, onExpand, onCollapse, onToggle, onNavigate, onMobileClose, onExpand, onCollapse, onToggle,
wasCollapsed, pickerOpenCallbackRef, auth, orgs, onSwitchOrganization, openSettings, wasCollapsed, pickerOpenCallbackRef, auth, orgs, onSwitchOrganization, openSettings, openOrgSettings,
}: SidebarContentProps) { }: SidebarContentProps) {
const router = useRouter() const router = useRouter()
const c = isMobile ? false : collapsed const c = isMobile ? false : collapsed
@@ -464,6 +465,7 @@ function SidebarContent({
onCreateOrganization={() => router.push('/onboarding')} onCreateOrganization={() => router.push('/onboarding')}
allowPersonalOrganization={false} allowPersonalOrganization={false}
onOpenSettings={openSettings} onOpenSettings={openSettings}
onOpenOrgSettings={openOrgSettings}
compact compact
anchor="right" anchor="right"
> >
@@ -565,6 +567,7 @@ export default function Sidebar({
orgs={orgs} orgs={orgs}
onSwitchOrganization={handleSwitchOrganization} onSwitchOrganization={handleSwitchOrganization}
openSettings={() => openUnifiedSettings({ context: 'account', tab: 'profile' })} openSettings={() => openUnifiedSettings({ context: 'account', tab: 'profile' })}
openOrgSettings={() => openUnifiedSettings({ context: 'workspace', tab: 'general' })}
/> />
</aside> </aside>
@@ -608,6 +611,7 @@ export default function Sidebar({
orgs={orgs} orgs={orgs}
onSwitchOrganization={handleSwitchOrganization} onSwitchOrganization={handleSwitchOrganization}
openSettings={() => openUnifiedSettings({ context: 'account', tab: 'profile' })} openSettings={() => openUnifiedSettings({ context: 'account', tab: 'profile' })}
openOrgSettings={() => openUnifiedSettings({ context: 'workspace', tab: 'general' })}
/> />
</aside> </aside>
</> </>