mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: ♻️ Rewrite authentication page
This commit is contained in:
parent
1194bc4ffb
commit
c483f35b99
26 changed files with 373 additions and 797 deletions
|
|
@ -1,16 +1,25 @@
|
|||
<template>
|
||||
<ErrorBoundary>
|
||||
<div class="mx-auto max-w-2xl w-full space-y-2">
|
||||
<TimelineScroller v-if="account">
|
||||
<AccountProfile :account="account" />
|
||||
<AccountTimeline v-if="accountId" :id="accountId" :key="accountId" />
|
||||
</TimelineScroller>
|
||||
<div class="mx-auto max-w-2xl w-full space-y-2">
|
||||
<div v-if="isLoading" class="p-4 flex items-center justify-center h-48">
|
||||
<Loader class="size-8 animate-spin" />
|
||||
</div>
|
||||
</ErrorBoundary>
|
||||
<TimelineScroller v-else-if="account">
|
||||
<AccountProfile :account="account" />
|
||||
<AccountTimeline v-if="accountId" :id="accountId" :key="accountId" />
|
||||
</TimelineScroller>
|
||||
<Card v-else class="shadow-none bg-transparent border-none p-4">
|
||||
<CardHeader class="text-center gap-y-4">
|
||||
<CardTitle class="text-">Account not found.</CardTitle>
|
||||
<CardDescription>
|
||||
Check for typos or try again later.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import ErrorBoundary from "~/components/errors/ErrorBoundary.vue";
|
||||
import { Loader } from "lucide-vue-next";
|
||||
import AccountProfile from "~/components/profiles/profile.vue";
|
||||
import AccountTimeline from "~/components/timelines/account.vue";
|
||||
import TimelineScroller from "~/components/timelines/timeline-scroller.vue";
|
||||
|
|
@ -24,7 +33,7 @@ const username = (route.params.username as string).startsWith("@")
|
|||
? (route.params.username as string).substring(1)
|
||||
: (route.params.username as string);
|
||||
|
||||
const account = useAccountFromAcct(client, username);
|
||||
const { account, isLoading } = useAccountFromAcct(client, username);
|
||||
const accountId = computed(() => account.value?.id ?? undefined);
|
||||
|
||||
useServerSeoMeta({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue