Update SideNavLink.svelte

The Icon throws as SSR error when used. This uses the same code as the HeaderGlobalAction which works with no errors
This commit is contained in:
David Sedman 2020-12-16 11:33:19 +00:00 committed by GitHub
commit 0789e3aea3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,8 +22,6 @@
/** Obtain a reference to the HTML anchor element */
export let ref = null;
import { Icon } from "../../Icon";
</script>
<li class:bx--side-nav__item="{true}">
@ -40,9 +38,8 @@
{#if icon}
<div
class:bx--side-nav__icon="{true}"
class:bx--side-nav__icon--small="{true}"
>
<Icon {...icon} />
class:bx--side-nav__icon--small="{true}">
<svelte:component this="{icon}" />
</div>
{/if}
<span class:bx--side-nav__link-text="{true}">{text}</span>