mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
refactor(button): remove redundant if statement
This commit is contained in:
parent
80d56f9f5f
commit
79d82da513
1 changed files with 12 additions and 16 deletions
|
@ -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}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue