2023-02-05 15:10:19 +03:00
|
|
|
<script setup>
|
|
|
|
const { busy, oauth, singleInstanceServer } = useSignIn()
|
|
|
|
</script>
|
|
|
|
|
2022-11-27 14:16:27 +03:00
|
|
|
<template>
|
2023-01-15 11:38:02 +03:00
|
|
|
<VDropdown v-if="isHydrated && currentUser" sm:hidden>
|
2022-11-27 14:16:27 +03:00
|
|
|
<div style="-webkit-touch-callout: none;">
|
|
|
|
<AccountAvatar
|
|
|
|
:account="currentUser.account"
|
2022-12-31 15:26:52 +03:00
|
|
|
h-8
|
|
|
|
w-8
|
2022-11-27 14:16:27 +03:00
|
|
|
:draggable="false"
|
2023-01-05 15:10:22 +03:00
|
|
|
square
|
2022-11-27 14:16:27 +03:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2022-12-15 16:50:11 +03:00
|
|
|
<template #popper="{ hide }">
|
2023-03-19 15:12:20 +03:00
|
|
|
<UserSwitcher @click="hide()" />
|
2022-11-27 14:16:27 +03:00
|
|
|
</template>
|
|
|
|
</VDropdown>
|
2023-02-05 15:10:19 +03:00
|
|
|
<template v-else>
|
|
|
|
<button
|
|
|
|
v-if="singleInstanceServer"
|
|
|
|
flex="~ row"
|
|
|
|
gap-x-1 items-center justify-center btn-solid text-sm px-2 py-1 xl:hidden
|
|
|
|
:disabled="busy"
|
|
|
|
@click="oauth()"
|
|
|
|
>
|
|
|
|
<span v-if="busy" aria-hidden="true" block animate animate-spin preserve-3d class="rtl-flip">
|
|
|
|
<span block i-ri:loader-2-fill aria-hidden="true" />
|
|
|
|
</span>
|
|
|
|
<span v-else aria-hidden="true" block i-ri:login-circle-line class="rtl-flip" />
|
|
|
|
<i18n-t keypath="action.sign_in_to">
|
|
|
|
<strong>{{ currentServer }}</strong>
|
|
|
|
</i18n-t>
|
|
|
|
</button>
|
2024-04-01 17:55:31 +03:00
|
|
|
<button
|
|
|
|
v-else
|
|
|
|
flex="~ row"
|
|
|
|
gap-x-1 items-center justify-center btn-solid text-sm px-2 py-1 xl:hidden
|
|
|
|
@click="openSigninDialog()"
|
|
|
|
>
|
|
|
|
<span aria-hidden="true" block i-ri:login-circle-line class="rtl-flip" />
|
2023-02-05 15:10:19 +03:00
|
|
|
{{ $t('action.sign_in') }}
|
|
|
|
</button>
|
|
|
|
</template>
|
2022-11-27 14:16:27 +03:00
|
|
|
</template>
|