mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
commit
fbf539ab1d
1 changed files with 5 additions and 12 deletions
|
@ -16,21 +16,14 @@
|
|||
import HamburgerMenu from './UIShellSideNav/HamburgerMenu.svelte';
|
||||
|
||||
let isSideNavOpen = undefined;
|
||||
let winWidth = window.innerWidth;
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
winWidth = window.innerWidth;
|
||||
|
||||
if (winWidth >= 1056) {
|
||||
isSideNavOpen = true;
|
||||
} else {
|
||||
isSideNavOpen = false;
|
||||
}
|
||||
});
|
||||
let winWidth = undefined;
|
||||
$: isSideNavOpen = winWidth >= 1056
|
||||
|
||||
$: ariaLabel = company + (uiShellAriaLabel || $$props['aria-label'] || platformName);
|
||||
</script>
|
||||
|
||||
<svelte:window bind:innerWidth={winWidth} />
|
||||
|
||||
<header aria-label={ariaLabel} class={cx('--header')} role="banner">
|
||||
{#if winWidth < 1056}
|
||||
<HamburgerMenu bind:isOpen={isSideNavOpen} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue