Skip to content

Commit

Permalink
Global Sidebar - prevent collapsed state from bleeding into other are…
Browse files Browse the repository at this point in the history
…as. (#90280)

* use sites dashboard as required condition for collapsed sidebar

* include sites section group

* revert to prevvious siteSelected check, add region check
  • Loading branch information
Addison-Stavlo authored May 3, 2024
1 parent 9d26afe commit 3ae3ac7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/state/global-sidebar/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ export const getShouldShowCollapsedGlobalSidebar = (
sectionGroup: string,
sectionName: string
) => {
const isAllowedRegion = sectionGroup === 'sites-dashboard' || sectionGroup === 'sites';
const siteSelected = sectionGroup === 'sites-dashboard' && !! siteId;
const siteLoaded = getShouldShowGlobalSiteSidebar( state, siteId, sectionGroup, sectionName );

return (
isEnabled( 'layout/dotcom-nav-redesign-v2' ) &&
isAllowedRegion &&
( siteSelected || siteLoaded || isWithinBreakpoint( '<782px' ) )
);
};
Expand Down

0 comments on commit 3ae3ac7

Please sign in to comment.