refactor: remove usage of deprecated Icon component (#1160)

This commit is contained in:
metonym 2022-03-12 13:52:59 -08:00 committed by GitHub
commit e2c980e23a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -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>

View file

@ -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>