Added option to set text for HeaderAction(Link) component

This commit is contained in:
Daniel Boven 2020-07-16 11:51:43 +02:00
commit 7f1a769889
4 changed files with 13 additions and 13 deletions

View file

@ -2,10 +2,11 @@
export let type = undefined;
export let icon = undefined;
export let isOpen = undefined;
export let text = undefined;
let elRigthPanel = undefined;
import { cx } from '../../../lib';
import { cx, optional } from '../../../lib';
import Icon from '../../Icon/Icon.svelte';
import { slide } from 'svelte/transition';
@ -23,12 +24,13 @@
<div>
<button
aria-label={type}
class={cx('--header__action', isOpen && '--header__action--active')}
class={cx('--header__action', isOpen && '--header__action--active', text && '--header__action--text')}
type="button"
on:click={() => {
isOpen = true;
}}>
<Icon {...icon} />
{optional(text)}
</button>
{#if isOpen}
<div
@ -38,4 +40,4 @@
<slot />
</div>
{/if}
</div>
</div>