mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(ui-shell): add Close/AppSwitcher as default HeaderAction icons
This commit is contained in:
parent
4b7d254560
commit
5f62cdeb82
2 changed files with 4 additions and 3 deletions
|
@ -24,9 +24,11 @@
|
|||
*/
|
||||
export let ref = null;
|
||||
|
||||
import { Icon } from "../../Icon";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import { slide } from "svelte/transition";
|
||||
import Close20 from "carbon-icons-svelte/lib/Close20";
|
||||
import AppSwitcher20 from "carbon-icons-svelte/lib/AppSwitcher20";
|
||||
import { Icon } from "../../Icon";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
|
@ -70,7 +72,7 @@
|
|||
isOpen = !isOpen;
|
||||
dispatch(isOpen ? 'open' : 'close');
|
||||
}}">
|
||||
<Icon {...icon} />
|
||||
<Icon render="{isOpen ? Close20 : AppSwitcher20}" {...icon} />
|
||||
<slot name="text">
|
||||
{#if text}<span>{text}</span>{/if}
|
||||
</slot>
|
||||
|
|
|
@ -193,7 +193,6 @@
|
|||
<HeaderUtilities>
|
||||
<HeaderAction
|
||||
type="Switcher"
|
||||
icon="{isOpen ? iAccount : iSwitcher}"
|
||||
bind:isOpen
|
||||
on:open="{() => {
|
||||
console.log('on:open');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue