feat(ui-shell): make Header name optional

This commit is contained in:
Eric Liu 2020-08-01 15:40:06 -07:00
commit 6645533912
2 changed files with 9 additions and 5 deletions

View file

@ -34,8 +34,9 @@
let winWidth = undefined;
$: isSideNavOpen = winWidth >= 1056;
$: ariaLabel =
company + " " + (uiShellAriaLabel || $$props["aria-label"] || platformName);
$: ariaLabel = company
? `${company} `
: "" + (uiShellAriaLabel || $$props["aria-label"] || platformName);
</script>
<svelte:window bind:innerWidth={winWidth} />
@ -45,8 +46,11 @@
<HamburgerMenu bind:isOpen={isSideNavOpen} />
{/if}
<a {href} class:bx--header__name={true} {...$$restProps} on:click>
<span class:bx--header__name--prefix={true}>{company}</span>
&nbsp;{platformName}
{#if company}
<span class:bx--header__name--prefix={true}>{company}</span>
&nbsp;
{/if}
{platformName}
</a>
<slot />
</header>

View file

@ -114,7 +114,7 @@
</script>
{#if story === 'header'}
<Header {...$$props}>
<Header {...$$props} company={undefined}>
<SkipToContent />
</Header>
{:else if story === 'sidenav'}