mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11: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;
|
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}
|
||||||
{platformName}
|
<span class:bx--header__name--prefix={true}>{company}</span>
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
{platformName}
|
||||||
</a>
|
</a>
|
||||||
<slot />
|
<slot />
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -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'}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue