From 66455339120e433369fd80c395e33872608309c3 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 1 Aug 2020 15:40:06 -0700 Subject: [PATCH] feat(ui-shell): make Header name optional --- src/UIShell/GlobalHeader/Header.svelte | 12 ++++++++---- src/UIShell/UIShell.Story.svelte | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/UIShell/GlobalHeader/Header.svelte b/src/UIShell/GlobalHeader/Header.svelte index dc684468..4275e87c 100644 --- a/src/UIShell/GlobalHeader/Header.svelte +++ b/src/UIShell/GlobalHeader/Header.svelte @@ -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); @@ -45,8 +46,11 @@ {/if} - {company} -  {platformName} + {#if company} + {company} +   + {/if} + {platformName} diff --git a/src/UIShell/UIShell.Story.svelte b/src/UIShell/UIShell.Story.svelte index 04f5883f..e09971b3 100644 --- a/src/UIShell/UIShell.Story.svelte +++ b/src/UIShell/UIShell.Story.svelte @@ -114,7 +114,7 @@ {#if story === 'header'} -
+
{:else if story === 'sidenav'}