mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
refactor: remove usage of deprecated Icon
component (#1160)
This commit is contained in:
parent
cb014219fd
commit
e2c980e23a
2 changed files with 6 additions and 6 deletions
|
@ -39,7 +39,6 @@
|
||||||
import { slide } from "svelte/transition";
|
import { slide } from "svelte/transition";
|
||||||
import Close20 from "../../icons/Close20.svelte";
|
import Close20 from "../../icons/Close20.svelte";
|
||||||
import AppSwitcher20 from "../../icons/AppSwitcher20.svelte";
|
import AppSwitcher20 from "../../icons/AppSwitcher20.svelte";
|
||||||
import Icon from "../../Icon/Icon.svelte";
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
@ -69,8 +68,11 @@
|
||||||
dispatch(isOpen ? 'open' : 'close');
|
dispatch(isOpen ? 'open' : 'close');
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
<Icon render="{icon}" style="{isOpen ? 'display: none' : ''}" />
|
<svelte:component this="{icon}" style="{isOpen ? 'display: none' : ''}" />
|
||||||
<Icon render="{closeIcon}" style="{!isOpen ? 'display: none' : ''}" />
|
<svelte:component
|
||||||
|
this="{closeIcon}"
|
||||||
|
style="{!isOpen ? 'display: none' : ''}"
|
||||||
|
/>
|
||||||
<slot name="text">
|
<slot name="text">
|
||||||
{#if text}<span>{text}</span>{/if}
|
{#if text}<span>{text}</span>{/if}
|
||||||
</slot>
|
</slot>
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
/** Obtain a reference to the HTML anchor element */
|
/** Obtain a reference to the HTML anchor element */
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import Icon from "../../Icon/Icon.svelte";
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
@ -29,7 +27,7 @@
|
||||||
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
>
|
>
|
||||||
<Icon render="{icon}" />
|
<svelte:component this="{icon}" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue