mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 19:49:16 +01:00
refactor: ♻️ Rewrite state system to use Pinia for composer and auth
This commit is contained in:
parent
a6db9e059d
commit
b510782a30
80 changed files with 999 additions and 1011 deletions
|
|
@ -18,6 +18,7 @@ import * as m from "~~/paraglide/messages.js";
|
|||
import AccountManager from "../account/account-manager.vue";
|
||||
|
||||
const { $pwa } = useNuxtApp();
|
||||
const authStore = useAuthStore();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -25,8 +26,8 @@ const { $pwa } = useNuxtApp();
|
|||
<SidebarMenu class="gap-3">
|
||||
<SidebarMenuItem>
|
||||
<AccountManager>
|
||||
<SidebarMenuButton v-if="identity" size="lg">
|
||||
<TinyCard :account="identity.account" :domain="identity.instance.domain" naked />
|
||||
<SidebarMenuButton v-if="authStore.account && authStore.instance" size="lg">
|
||||
<TinyCard :account="authStore.account" :domain="authStore.instance.domain" naked />
|
||||
<ChevronsUpDown class="ml-auto size-4" />
|
||||
</SidebarMenuButton>
|
||||
<SidebarMenuButton v-else>
|
||||
|
|
@ -37,14 +38,14 @@ const { $pwa } = useNuxtApp();
|
|||
</AccountManager>
|
||||
</SidebarMenuItem>
|
||||
<SidebarMenuItem class="flex flex-col gap-2">
|
||||
<Button v-if="identity" variant="default" size="lg" class="w-full group-data-[collapsible=icon]:px-4"
|
||||
<Button v-if="authStore.isSignedIn" variant="default" size="lg" class="w-full group-data-[collapsible=icon]:px-4"
|
||||
@click="useEvent('composer:open')">
|
||||
<Pen />
|
||||
<span class="group-data-[collapsible=icon]:hidden">
|
||||
{{ m.salty_aloof_turkey_nudge() }}
|
||||
</span>
|
||||
</Button>
|
||||
<Button v-if="identity" size="lg" variant="secondary" @click="useEvent('preferences:open')">
|
||||
<Button v-if="authStore.isSignedIn" size="lg" variant="secondary" @click="useEvent('preferences:open')">
|
||||
<Cog />
|
||||
Preferences
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue