Skip to content

Commit

Permalink
Move conditional props to a single spreadable object
Browse files Browse the repository at this point in the history
  • Loading branch information
avinashbot committed Dec 2, 2024
1 parent 3761ab3 commit 4eb02bf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/app-layout/visual-refresh-toolbar/toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export function AppLayoutToolbarImplementation({
}, [anyPanelOpenInMobile]);

const toolbarHidden = toolbarState === 'hide' && !pinnedToolbar;
const navLandmarkAttributes = navigationOpen
? { role: 'presentation' }
: { role: 'navigation', 'aria-label': ariaLabels?.navigation };

return (
<ToolbarSlot
Expand All @@ -180,11 +183,7 @@ export function AppLayoutToolbarImplementation({
>
<div className={styles['toolbar-container']}>
{hasNavigation && (
<nav
className={clsx(styles['universal-toolbar-nav'])}
role={navigationOpen ? 'presentation' : 'navigation'}
aria-label={navigationOpen ? undefined : ariaLabels?.navigation}
>
<nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>
<TriggerButton
ariaLabel={ariaLabels?.navigationToggle ?? undefined}
ariaExpanded={false}
Expand Down

0 comments on commit 4eb02bf

Please sign in to comment.