design: add icon
This commit is contained in:
1 parent
005a8c0e07
commit
3955316195
1 file changed
+7
-3
@@ -23,6 +23,7 @@
|
|||||||
import {
|
import {
|
||||||
ArrowLeftOnRectangle,
|
ArrowLeftOnRectangle,
|
||||||
ArrowRightOnRectangle,
|
ArrowRightOnRectangle,
|
||||||
|
ArrowsRightLeft,
|
||||||
ArrowUturnLeft,
|
ArrowUturnLeft,
|
||||||
BugAnt,
|
BugAnt,
|
||||||
Check,
|
Check,
|
||||||
@@ -184,21 +185,24 @@
|
|||||||
? 'Switch'
|
? 'Switch'
|
||||||
: 'Current'}
|
: 'Current'}
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
if (profile.id == $currentProfile?.id) setUserID(-1)
|
if (profile.id != $currentProfile?.id) {
|
||||||
else {
|
|
||||||
switching = profile.id
|
switching = profile.id
|
||||||
await setUserID(profile.id)
|
await setUserID(profile.id)
|
||||||
switching = -69
|
switching = -69
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
color={profile.id == $currentProfile?.id ? 'primary' : 'secondary'}
|
color={profile.id == $currentProfile?.id ? 'primary' : 'ghost'}
|
||||||
loading={switching == profile.id}
|
loading={switching == profile.id}
|
||||||
disabled={switching == profile.id}
|
disabled={switching == profile.id}
|
||||||
>
|
>
|
||||||
|
<svelte:fragment slot="prefix">
|
||||||
{#if profile.id == $currentProfile?.id}
|
{#if profile.id == $currentProfile?.id}
|
||||||
<Icon src={Check} mini size="16" />
|
<Icon src={Check} mini size="16" />
|
||||||
|
{:else}
|
||||||
|
<Icon src={ArrowsRightLeft} size="16" mini />
|
||||||
{/if}
|
{/if}
|
||||||
|
</svelte:fragment>
|
||||||
</Button>
|
</Button>
|
||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
<Button size="square-md" slot="target">
|
<Button size="square-md" slot="target">
|
||||||
|
|||||||
Reference in new issue
Block a user