mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(ui-shell): make Header name optional
This commit is contained in:
parent
4d93396d01
commit
6645533912
2 changed files with 9 additions and 5 deletions
|
@ -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>
|
||||
{platformName}
|
||||
{#if company}
|
||||
<span class:bx--header__name--prefix={true}>{company}</span>
|
||||
|
||||
{/if}
|
||||
{platformName}
|
||||
</a>
|
||||
<slot />
|
||||
</header>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue