refactor: Reduce repetition by adding icon arguments to Button

This commit is contained in:
Ushie
2024-12-22 03:19:02 +03:00
parent 2f24780f34
commit 24650c71a9
4 changed files with 15 additions and 13 deletions

View File

@@ -25,7 +25,7 @@
<a href={url} rel="noreferrer" target="_blank" on:click|stopPropagation>
<h4>{name}</h4>
</a>
<div id="arrow" style:transform={expanded ? 'rotate(0deg)' : 'rotate(-180deg)'}>
<div id="arrow" style:transform={expanded ? 'rotate(0deg)' : 'rotate(180deg)'}>
<ChevronUp size="24px" color="var(--surface-six)" />
</div>
</div>

View File

@@ -91,13 +91,16 @@
<div class="buttons">
<Query {query} let:data>
{#if !isAndroid || androidVersion < 8}
<Button on:click={handleClick} type="filled">
<TrayArrowDown size="20px" />
<Button on:click={handleClick} icon={TrayArrowDown} type="filled">
{data.release.version}
</Button>
{:else}
<Button on:click={handleClick} type="filled" href={data.release.download_url}>
<TrayArrowDown size="20px" />
<Button
on:click={handleClick}
icon={TrayArrowDown}
type="filled"
href={data.release.download_url}
>
{data.release.version}
</Button>
{/if}