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