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

View file

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