refactor(button): remove redundant if statement

This commit is contained in:
Eric Liu 2020-11-19 16:18:05 -08:00
commit 79d82da513

View file

@ -135,14 +135,12 @@
<span class:bx--assistive-text="{true}">{iconDescription}</span>
{/if}
<slot />
{#if icon}
<svelte:component
this="{icon}"
aria-hidden="true"
class="bx--btn__icon"
aria-label="{iconDescription}"
/>
{/if}
<svelte:component
this="{icon}"
aria-hidden="true"
class="bx--btn__icon"
aria-label="{iconDescription}"
/>
</a>
{:else}
<button
@ -157,14 +155,12 @@
<span class:bx--assistive-text="{true}">{iconDescription}</span>
{/if}
<slot />
{#if icon}
<svelte:component
this="{icon}"
aria-hidden="true"
class="bx--btn__icon"
aria-label="{iconDescription}"
/>
{/if}
<svelte:component
this="{icon}"
aria-hidden="true"
class="bx--btn__icon"
aria-label="{iconDescription}"
/>
</button>
{/if}
{/if}