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
|
|
@ -1,15 +1,15 @@
|
|||
<template>
|
||||
<SidebarProvider>
|
||||
<AppSidebar>
|
||||
<slot v-if="!route.meta.requiresAuth || identity" />
|
||||
<slot v-if="!route.meta.requiresAuth || authStore.isSignedIn" />
|
||||
<div class="mx-auto max-w-4xl p-4" v-else>
|
||||
<AuthRequired />
|
||||
</div>
|
||||
</AppSidebar>
|
||||
</SidebarProvider>
|
||||
<MobileNavbar v-if="identity" />
|
||||
<MobileNavbar v-if="authStore.isSignedIn" />
|
||||
<Preferences />
|
||||
<ComposerDialog v-if="identity" />
|
||||
<ComposerDialog v-if="authStore.isSignedIn" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
@ -23,6 +23,7 @@ import { SidebarProvider } from "~/components/ui/sidebar";
|
|||
const colorMode = useColorMode();
|
||||
const { n, d } = useMagicKeys();
|
||||
const activeElement = useActiveElement();
|
||||
const authStore = useAuthStore();
|
||||
const notUsingInput = computed(
|
||||
() =>
|
||||
activeElement.value?.tagName !== "INPUT" &&
|
||||
|
|
|
|||
11
app/layouts/auth.vue
Normal file
11
app/layouts/auth.vue
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<template>
|
||||
<div class="flex h-svh items-center justify-center px-6 py-12 lg:px-8 bg-center bg-no-repeat bg-cover" :style="{
|
||||
backgroundImage: 'url(/images/banner.webp)',
|
||||
}">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
</script>
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
<template>
|
||||
<slot />
|
||||
<ComposerDialog v-if="identity" />
|
||||
<ComposerDialog v-if="authStore.isSignedIn" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComposerDialog from "~/components/composer/dialog.vue";
|
||||
|
||||
const authStore = useAuthStore();
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue