mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
refactor: ♻️ Fix more broken UIs, rewrite account switcher
This commit is contained in:
parent
ac0a571ecc
commit
a4d42e3086
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<EditorContent :editor="editor"
|
<EditorContent :editor="editor"
|
||||||
:class="[$style.content, 'prose prose-sm dark:prose-invert break-words prose-a:no-underline prose-a:hover:underline prose-p:*:first-of-type:mt-0']" />
|
:class="[$style.content, 'prose prose-sm dark:prose-invert break-words prose-a:no-underline prose-a:hover:underline prose-p:first-of-type:mt-0']" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<Alert class="grid grid-cols-[1fr_auto]">
|
<Alert layout="button" class="grid">
|
||||||
<LogIn class="size-4" />
|
<LogIn />
|
||||||
<AlertTitle>{{ m.sunny_quick_lionfish_flip() }}</AlertTitle>
|
<AlertTitle>{{ m.sunny_quick_lionfish_flip() }}</AlertTitle>
|
||||||
<AlertDescription class="col-start-1">
|
<AlertDescription>
|
||||||
{{ m.brave_known_pelican_drip() }}
|
{{ m.brave_known_pelican_drip() }}
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
<!-- Add pl-4 because Alert is adding additional padding, which we don't want -->
|
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
class="w-full col-start-2 row-start-1 row-span-2 !pl-4"
|
class="w-full"
|
||||||
@click="signInAction"
|
@click="signInAction"
|
||||||
>
|
>
|
||||||
{{ m.fuzzy_sea_moth_absorb() }}
|
{{ m.fuzzy_sea_moth_absorb() }}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<Card class="size-16">
|
<Card class="flex items-center justify-center">
|
||||||
<Loader class="size-full animate-spin" />
|
<Loader class="size-6 animate-spin" />
|
||||||
</Card>
|
</Card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
</Popover>
|
</Popover>
|
||||||
</Card>
|
</Card>
|
||||||
<DialogContent :hide-close="true"
|
<DialogContent :hide-close="true"
|
||||||
class="fixed inset-0 z-50 w-screen h-screen p-6 duration-200 bg-transparent border-none grid grid-rows-[auto,1fr,auto] overflow-hidden translate-x-0 translate-y-0 max-w-full !animate-none gap-6">
|
class="fixed inset-0 z-50 w-screen h-screen p-6 duration-200 bg-transparent border-none grid grid-rows-[auto_1fr_auto] overflow-hidden translate-x-0 translate-y-0 max-w-full !animate-none gap-6">
|
||||||
<div class="flex flex-row gap-2 w-full">
|
<div class="flex flex-row gap-2 w-full">
|
||||||
<DialogTitle class="sr-only">{{ attachment.type }}</DialogTitle>
|
<DialogTitle class="sr-only">{{ attachment.type }}</DialogTitle>
|
||||||
<Button as="a" :href="attachment?.url" target="_blank" :download="true" variant="ghost" size="icon"
|
<Button as="a" :href="attachment?.url" target="_blank" :download="true" variant="ghost" size="icon"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<Card class="*:w-full p-2">
|
<Card class="*:w-full p-2">
|
||||||
<Collapsible :default-open="true" v-slot="{ open }">
|
<Collapsible :default-open="true" v-slot="{ open }" class="space-y-1">
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger :as-child="true">
|
<TooltipTrigger :as-child="true">
|
||||||
<CardHeader
|
<CardHeader
|
||||||
v-if="notification.account"
|
v-if="notification.account"
|
||||||
class="flex-row items-center gap-2 px-2"
|
class="flex flex-row items-center gap-2 px-2"
|
||||||
>
|
>
|
||||||
<component :is="icon" class="size-5 shrink-0" />
|
<component :is="icon" class="size-5 shrink-0" />
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
class="grid justify-normal items-center px-6 py-4 gap-4"
|
class="grid justify-normal items-center px-6 py-4 gap-4"
|
||||||
v-slot="{ open }"
|
v-slot="{ open }"
|
||||||
>
|
>
|
||||||
<div class="grid grid-cols-[1fr,auto] items-center gap-4">
|
<div class="grid grid-cols-[1fr_auto] items-center gap-4">
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<CardTitle class="text-base">
|
<CardTitle class="text-base">
|
||||||
{{ setting.title() }}
|
{{ setting.title() }}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<Collapsible :default-open="true">
|
<Collapsible :default-open="true">
|
||||||
<div class="grid grid-cols-[1fr,auto] gap-4 items-baseline">
|
<div class="grid grid-cols-[1fr_auto] gap-4 items-baseline">
|
||||||
<h2 class="text-2xl font-semibold tracking-tight">
|
<h2 class="text-2xl font-semibold tracking-tight">
|
||||||
{{ name }}
|
{{ name }}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
cn(
|
cn(
|
||||||
'grid hover:cursor-pointer gap-4 items-center p-4',
|
'grid hover:cursor-pointer gap-4 items-center p-4',
|
||||||
canEdit
|
canEdit
|
||||||
? 'grid-cols-[auto,1fr,auto]'
|
? 'grid-cols-[auto_1fr_auto]'
|
||||||
: 'grid-cols-[auto,1fr]'
|
: 'grid-cols-[auto_1fr]'
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@
|
||||||
:as="Card"
|
:as="Card"
|
||||||
>
|
>
|
||||||
<FormItem
|
<FormItem
|
||||||
class="grid grid-cols-[1fr,auto] items-center p-6 gap-2"
|
class="grid grid-cols-[1fr_auto] items-center gap-2"
|
||||||
>
|
>
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<FormLabel :as="CardTitle">
|
<FormLabel :as="CardTitle">
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<div
|
<div
|
||||||
v-for="(field, index) in value"
|
v-for="(field, index) in value"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="grid items-center grid-cols-[auto,repeat(3,minmax(0,1fr))] gap-2"
|
class="grid items-center grid-cols-[auto_repeat(3,minmax(0,1fr))] gap-2"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
|
|
@ -159,7 +159,7 @@
|
||||||
class="block"
|
class="block"
|
||||||
>
|
>
|
||||||
<FormItem
|
<FormItem
|
||||||
class="grid grid-cols-[1fr,auto] items-center p-6 gap-2"
|
class="grid grid-cols-[1fr_auto] items-center gap-2"
|
||||||
>
|
>
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<FormLabel :as="CardTitle">
|
<FormLabel :as="CardTitle">
|
||||||
|
|
@ -187,7 +187,7 @@
|
||||||
class="block"
|
class="block"
|
||||||
>
|
>
|
||||||
<FormItem
|
<FormItem
|
||||||
class="grid grid-cols-[1fr,auto] items-center p-6 gap-2"
|
class="grid grid-cols-[1fr_auto] items-center gap-2"
|
||||||
>
|
>
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<FormLabel :as="CardTitle">
|
<FormLabel :as="CardTitle">
|
||||||
|
|
@ -215,7 +215,7 @@
|
||||||
class="block"
|
class="block"
|
||||||
>
|
>
|
||||||
<FormItem
|
<FormItem
|
||||||
class="grid grid-cols-[1fr,auto] items-center p-6 gap-2"
|
class="grid grid-cols-[1fr_auto] items-center gap-2"
|
||||||
>
|
>
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<FormLabel :as="CardTitle">
|
<FormLabel :as="CardTitle">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Card class="grid grid-cols-[1fr,auto] items-center px-6 py-4 gap-2">
|
<Card class="grid grid-cols-[1fr_auto] items-center px-6 py-4 gap-2">
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<CardTitle class="text-base">
|
<CardTitle class="text-base">
|
||||||
{{ setting.title() }}
|
{{ setting.title() }}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Card class="grid grid-rows-[1fr,auto] xl:grid-rows-none xl:grid-cols-[1fr,auto] items-center px-6 py-4 gap-4">
|
<Card class="grid grid-rows-[1fr_auto] xl:grid-rows-none xl:grid-cols-[1fr_auto] items-center px-6 py-4 gap-4">
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<CardTitle class="text-base">
|
<CardTitle class="text-base">
|
||||||
{{ setting.title() }}
|
{{ setting.title() }}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Card class="grid grid-cols-[1fr,auto] items-center px-6 py-4 gap-2">
|
<Card class="grid grid-cols-[1fr_auto] items-center px-6 py-4 gap-2">
|
||||||
<CardHeader class="space-y-0.5 p-0">
|
<CardHeader class="space-y-0.5 p-0">
|
||||||
<CardTitle class="text-base">
|
<CardTitle class="text-base">
|
||||||
{{ setting.title() }}
|
{{ setting.title() }}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Avatar :class="shape.value === 'square' && 'rounded-md'" :size="size">
|
<Avatar :class="shape.value === 'square' && 'rounded-md'">
|
||||||
<AvatarFallback v-if="name">
|
<AvatarFallback v-if="name">
|
||||||
{{ getInitials(name) }}
|
{{ getInitials(name) }}
|
||||||
</AvatarFallback>
|
</AvatarFallback>
|
||||||
|
|
@ -11,10 +11,9 @@
|
||||||
import { SettingIds } from "~/settings";
|
import { SettingIds } from "~/settings";
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
||||||
|
|
||||||
const { name, size = "base" } = defineProps<{
|
const { name } = defineProps<{
|
||||||
src?: string;
|
src?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
size?: "base" | "sm" | "lg";
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<Card
|
<Card
|
||||||
class="flex-row gap-4 p-2"
|
class="flex-row gap-2 p-2 truncate items-center"
|
||||||
:class="naked ? 'p-0 bg-transparent ring-0 border-none' : ''"
|
:class="naked ? 'p-0 bg-transparent ring-0 border-none' : ''"
|
||||||
>
|
>
|
||||||
<Avatar :src="account.avatar" :name="account.display_name" size="sm" />
|
<Avatar :src="account.avatar" :name="account.display_name" class="size-10" />
|
||||||
<CardContent class="gap-1">
|
<CardContent class="leading-tight">
|
||||||
<span
|
<span
|
||||||
class="truncate font-semibold"
|
class="font-semibold"
|
||||||
v-render-emojis="account.emojis"
|
v-render-emojis="account.emojis"
|
||||||
>{{ account.display_name }}</span
|
>{{ account.display_name }}</span
|
||||||
>
|
>
|
||||||
<span class="truncate text-xs">
|
<span class="text-xs">
|
||||||
@{{ account.username }}@{{ domain }}
|
@{{ account.username }}@{{ domain }}
|
||||||
</span>
|
</span>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|
|
||||||
92
components/sidebars/account/account-manager.vue
Normal file
92
components/sidebars/account/account-manager.vue
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
<template>
|
||||||
|
<Dialog>
|
||||||
|
<DialogTrigger as-child>
|
||||||
|
<slot />
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Accounts</DialogTitle>
|
||||||
|
<DialogDescription class="sr-only">
|
||||||
|
Manage your accounts and settings.
|
||||||
|
</DialogDescription>
|
||||||
|
</DialogHeader>
|
||||||
|
<div v-if="identities.length > 0" class="grid gap-4 py-2">
|
||||||
|
<div v-for="identity of identities" :key="identity.account.id"
|
||||||
|
class="grid grid-cols-[1fr_auto] has-[>[data-switch]]:grid-cols-[1fr_auto_auto] gap-2">
|
||||||
|
<TinyCard :account="identity.account" :domain="identity.instance.domain" naked />
|
||||||
|
<Button data-switch v-if="currentIdentity?.id !== identity.id"
|
||||||
|
@click="switchAccount(identity.account.id)" variant="outline">
|
||||||
|
Switch
|
||||||
|
</Button>
|
||||||
|
<Button @click="signOut(appData, identity)" variant="outline" size="icon"
|
||||||
|
:title="m.sharp_big_mallard_reap()">
|
||||||
|
<LogOut />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p class="text-sm text-muted-foreground">
|
||||||
|
Log in to or register an account on your favourite instance.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<DialogFooter>
|
||||||
|
<Button :as="NuxtLink" href="/register" variant="outline">
|
||||||
|
<UserPlus />
|
||||||
|
{{ m.honest_few_baboon_pop() }}
|
||||||
|
</Button>
|
||||||
|
<Button @click="signInAction">
|
||||||
|
<LogIn />
|
||||||
|
{{ m.sunny_pink_hyena_walk() }}
|
||||||
|
</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import type { Account } from "@versia/client/types";
|
||||||
|
import { ChevronsUpDown, LogIn, LogOut, UserPlus } from "lucide-vue-next";
|
||||||
|
import { toast } from "vue-sonner";
|
||||||
|
import TinyCard from "~/components/profiles/tiny-card.vue";
|
||||||
|
import { Button } from "~/components/ui/button";
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogDescription,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
DialogTrigger,
|
||||||
|
} from "~/components/ui/dialog";
|
||||||
|
import * as m from "~/paraglide/messages.js";
|
||||||
|
import { NuxtLink } from "#components";
|
||||||
|
import { identity as currentIdentity } from "#imports";
|
||||||
|
|
||||||
|
const appData = useAppData();
|
||||||
|
|
||||||
|
const signInAction = async () => signIn(appData, await askForInstance());
|
||||||
|
|
||||||
|
const switchAccount = async (userId: string) => {
|
||||||
|
if (userId === currentIdentity.value?.account.id) {
|
||||||
|
return await navigateTo(`/@${currentIdentity.value.account.username}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const id = toast.loading("Switching account...");
|
||||||
|
|
||||||
|
const identityToSwitch = identities.value.find(
|
||||||
|
(i) => i.account.id === userId,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!identityToSwitch) {
|
||||||
|
toast.dismiss(id);
|
||||||
|
toast.error("No identity to switch to");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentIdentity.value = identityToSwitch;
|
||||||
|
toast.dismiss(id);
|
||||||
|
toast.success("Switched account");
|
||||||
|
|
||||||
|
window.location.href = "/";
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { BadgeCheck, LogIn, LogOut, UserPlus } from "lucide-vue-next";
|
|
||||||
import { toast } from "vue-sonner";
|
|
||||||
import TinyCard from "~/components/profiles/tiny-card.vue";
|
|
||||||
import {
|
|
||||||
DropdownMenu,
|
|
||||||
DropdownMenuContent,
|
|
||||||
DropdownMenuGroup,
|
|
||||||
DropdownMenuItem,
|
|
||||||
DropdownMenuLabel,
|
|
||||||
DropdownMenuSeparator,
|
|
||||||
DropdownMenuTrigger,
|
|
||||||
} from "~/components/ui/dropdown-menu";
|
|
||||||
import * as m from "~/paraglide/messages.js";
|
|
||||||
import { NuxtLink } from "#components";
|
|
||||||
|
|
||||||
const appData = useAppData();
|
|
||||||
|
|
||||||
const signInAction = async () => signIn(appData, await askForInstance());
|
|
||||||
|
|
||||||
const switchAccount = async (userId: string) => {
|
|
||||||
if (userId === identity.value?.account.id) {
|
|
||||||
return await navigateTo(`/@${identity.value.account.username}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const id = toast.loading("Switching account...");
|
|
||||||
|
|
||||||
const identityToSwitch = identities.value.find(
|
|
||||||
(i) => i.account.id === userId,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!identityToSwitch) {
|
|
||||||
toast.dismiss(id);
|
|
||||||
toast.error("No identity to switch to");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
identity.value = identityToSwitch;
|
|
||||||
toast.dismiss(id);
|
|
||||||
toast.success("Switched account");
|
|
||||||
|
|
||||||
window.location.href = "/";
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<DropdownMenu>
|
|
||||||
<DropdownMenuTrigger :as-child="true">
|
|
||||||
<slot />
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent>
|
|
||||||
<DropdownMenuLabel> Your accounts </DropdownMenuLabel>
|
|
||||||
<DropdownMenuSeparator />
|
|
||||||
<DropdownMenuGroup>
|
|
||||||
<DropdownMenuItem
|
|
||||||
v-for="identity of identities"
|
|
||||||
:key="identity.account.id"
|
|
||||||
@click="switchAccount(identity.account.id)"
|
|
||||||
:href="`/@${identity.account.username}`"
|
|
||||||
>
|
|
||||||
<TinyCard
|
|
||||||
:account="identity.account"
|
|
||||||
:domain="identity.instance.domain"
|
|
||||||
naked
|
|
||||||
/>
|
|
||||||
</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem @click="signInAction">
|
|
||||||
<UserPlus />
|
|
||||||
{{ m.sunny_pink_hyena_walk() }}
|
|
||||||
</DropdownMenuItem>
|
|
||||||
</DropdownMenuGroup>
|
|
||||||
<DropdownMenuSeparator v-if="identity" />
|
|
||||||
<DropdownMenuGroup v-if="identity">
|
|
||||||
<DropdownMenuItem
|
|
||||||
:as="NuxtLink"
|
|
||||||
:href="`/@${identity.account.username}`"
|
|
||||||
>
|
|
||||||
<BadgeCheck />
|
|
||||||
{{ m.factual_arable_jurgen_endure() }}
|
|
||||||
</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem @click="signOut(appData, identity)">
|
|
||||||
<LogOut />
|
|
||||||
{{ m.sharp_big_mallard_reap() }}
|
|
||||||
</DropdownMenuItem>
|
|
||||||
</DropdownMenuGroup>
|
|
||||||
<DropdownMenuItem v-else :as="NuxtLink" href="/register">
|
|
||||||
<LogIn />
|
|
||||||
{{ m.honest_few_baboon_pop() }}
|
|
||||||
</DropdownMenuItem>
|
|
||||||
</DropdownMenuContent>
|
|
||||||
</DropdownMenu>
|
|
||||||
</template>
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ChevronsUpDown, DownloadCloud, Pen } from "lucide-vue-next";
|
import { ChevronsUpDown, DownloadCloud, Pen, UserPlus } from "lucide-vue-next";
|
||||||
import TinyCard from "~/components/profiles/tiny-card.vue";
|
import TinyCard from "~/components/profiles/tiny-card.vue";
|
||||||
import { Button } from "~/components/ui/button";
|
import { Button } from "~/components/ui/button";
|
||||||
import {
|
import {
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
} from "~/components/ui/sidebar";
|
} from "~/components/ui/sidebar";
|
||||||
import * as m from "~/paraglide/messages.js";
|
import * as m from "~/paraglide/messages.js";
|
||||||
import AccountSwitcher from "../account/account-switcher.vue";
|
import AccountManager from "../account/account-manager.vue";
|
||||||
const { $pwa } = useNuxtApp();
|
const { $pwa } = useNuxtApp();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -17,38 +17,28 @@ const { $pwa } = useNuxtApp();
|
||||||
<SidebarFooter>
|
<SidebarFooter>
|
||||||
<SidebarMenu class="gap-3">
|
<SidebarMenu class="gap-3">
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<AccountSwitcher>
|
<AccountManager>
|
||||||
<SidebarMenuButton size="lg">
|
<SidebarMenuButton v-if="identity" size="lg">
|
||||||
<TinyCard
|
<TinyCard :account="identity.account" :domain="identity.instance.domain" naked />
|
||||||
v-if="identity"
|
|
||||||
:account="identity.account"
|
|
||||||
:domain="identity.instance.domain"
|
|
||||||
naked
|
|
||||||
/>
|
|
||||||
<ChevronsUpDown class="ml-auto size-4" />
|
<ChevronsUpDown class="ml-auto size-4" />
|
||||||
</SidebarMenuButton>
|
</SidebarMenuButton>
|
||||||
</AccountSwitcher>
|
<SidebarMenuButton v-else>
|
||||||
|
<UserPlus />
|
||||||
|
{{ m.sunny_pink_hyena_walk() }}
|
||||||
|
<ChevronsUpDown class="ml-auto size-4" />
|
||||||
|
</SidebarMenuButton>
|
||||||
|
</AccountManager>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
<SidebarMenuItem class="flex flex-col gap-2">
|
<SidebarMenuItem class="flex flex-col gap-2">
|
||||||
<Button
|
<Button v-if="identity" variant="default" size="lg" class="w-full group-data-[collapsible=icon]:px-4"
|
||||||
v-if="identity"
|
@click="useEvent('composer:open')">
|
||||||
variant="default"
|
|
||||||
size="lg"
|
|
||||||
class="w-full group-data-[collapsible=icon]:px-4"
|
|
||||||
@click="useEvent('composer:open')"
|
|
||||||
>
|
|
||||||
<Pen />
|
<Pen />
|
||||||
<span class="group-data-[collapsible=icon]:hidden">
|
<span class="group-data-[collapsible=icon]:hidden">
|
||||||
{{ m.salty_aloof_turkey_nudge() }}
|
{{ m.salty_aloof_turkey_nudge() }}
|
||||||
</span>
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button v-if="$pwa?.needRefresh" variant="destructive" size="lg"
|
||||||
v-if="$pwa?.needRefresh"
|
class="w-full group-data-[collapsible=icon]:px-4" @click="$pwa?.updateServiceWorker(true)">
|
||||||
variant="destructive"
|
|
||||||
size="lg"
|
|
||||||
class="w-full group-data-[collapsible=icon]:px-4"
|
|
||||||
@click="$pwa?.updateServiceWorker(true)"
|
|
||||||
>
|
|
||||||
<DownloadCloud />
|
<DownloadCloud />
|
||||||
<span class="group-data-[collapsible=icon]:hidden">
|
<span class="group-data-[collapsible=icon]:hidden">
|
||||||
{{ m.quaint_low_felix_pave() }}
|
{{ m.quaint_low_felix_pave() }}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export const alertVariants = cva(
|
||||||
layout: {
|
layout: {
|
||||||
default:
|
default:
|
||||||
"has-[>svg]:grid-cols-[1fr_auto] grid-rows-2 gap-x-3 gap-y-1 items-start",
|
"has-[>svg]:grid-cols-[1fr_auto] grid-rows-2 gap-x-3 gap-y-1 items-start",
|
||||||
button: "grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-0.5",
|
button: "grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-0.5 *:data-[slot=alert-description]:col-start-2 *:data-[slot=alert-description]:row-start-2 has-[>[data-slot=alert-description]]:[&>button]:row-span-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const delegatedProps = computed(() => {
|
||||||
<AvatarFallback
|
<AvatarFallback
|
||||||
data-slot="avatar-fallback"
|
data-slot="avatar-fallback"
|
||||||
v-bind="delegatedProps"
|
v-bind="delegatedProps"
|
||||||
:class="cn('bg-muted flex size-full items-center justify-center rounded-full', props.class)"
|
:class="cn('bg-muted flex size-full items-center justify-center', props.class)"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</AvatarFallback>
|
</AvatarFallback>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const props = defineProps<{
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div data-slot="card" :class="cn(
|
<div data-slot="card" :class="cn(
|
||||||
'bg-card text-card-foreground flex flex-col gap-6 rounded-md border py-6 shadow-sm',
|
'bg-card text-card-foreground flex flex-col gap-6 rounded-md border p-6 shadow-sm',
|
||||||
props.class,
|
props.class,
|
||||||
)
|
)
|
||||||
">
|
">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const props = defineProps<{
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
data-slot="card-content"
|
data-slot="card-content"
|
||||||
:class="cn('px-6', props.class)"
|
:class="cn('flex flex-col', props.class)"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const props = defineProps<{
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
data-slot="card-footer"
|
data-slot="card-footer"
|
||||||
:class="cn('flex items-center px-6 [.border-t]:pt-6', props.class)"
|
:class="cn('flex items-center [.border-t]:pt-6', props.class)"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const props = defineProps<{
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
data-slot="card-header"
|
data-slot="card-header"
|
||||||
:class="cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', props.class)"
|
:class="cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', props.class)"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const delegatedProps = computed(() => {
|
||||||
<DialogOverlay
|
<DialogOverlay
|
||||||
data-slot="dialog-overlay"
|
data-slot="dialog-overlay"
|
||||||
v-bind="delegatedProps"
|
v-bind="delegatedProps"
|
||||||
:class="cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80', props.class)"
|
:class="cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80 backdrop-blur-md', props.class)"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</DialogOverlay>
|
</DialogOverlay>
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,13 @@ watch(isValidUrl, (value) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="space-y-3">
|
<div class="space-y-2">
|
||||||
<Input v-model="modelValue" v-bind="$attrs" />
|
<Input v-model="modelValue" v-bind="$attrs" />
|
||||||
<p v-if="isValidUrl" class="text-green-600 text-sm"><Check class="inline size-4" /> {{ m.sunny_small_warbler_express() }}</p>
|
<p v-if="isValidUrl" class="text-green-600 text-xs">
|
||||||
<p v-else-if="(modelValue?.toString().length ?? 0) > 0" class="text-destructive text-sm"><X class="inline size-4" /> {{ m.teal_late_grebe_blend() }}</p>
|
{{ m.sunny_small_warbler_express() }}
|
||||||
|
</p>
|
||||||
|
<p v-else-if="(modelValue?.toString().length ?? 0) > 0" class="text-destructive text-xs">
|
||||||
|
{{ m.teal_late_grebe_blend() }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
||||||
<div
|
<div
|
||||||
v-if="collapsible === 'none'"
|
v-if="collapsible === 'none'"
|
||||||
data-slot="sidebar"
|
data-slot="sidebar"
|
||||||
:class="cn('bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col', props.class)"
|
:class="cn('bg-sidebar text-sidebar-foreground flex h-dvh w-(--sidebar-width) flex-col', props.class)"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
<AppSidebar>
|
<AppSidebar>
|
||||||
<slot v-if="!route.meta.requiresAuth || identity" />
|
<slot v-if="!route.meta.requiresAuth || identity" />
|
||||||
<AuthRequired v-else />
|
<div class="mx-auto max-w-4xl p-4" v-else>
|
||||||
|
<AuthRequired />
|
||||||
|
</div>
|
||||||
</AppSidebar>
|
</AppSidebar>
|
||||||
</SidebarProvider>
|
</SidebarProvider>
|
||||||
<MobileNavbar v-if="identity" />
|
<MobileNavbar v-if="identity" />
|
||||||
|
|
@ -27,10 +29,6 @@ const notUsingInput = computed(
|
||||||
activeElement.value?.tagName !== "TEXTAREA" &&
|
activeElement.value?.tagName !== "TEXTAREA" &&
|
||||||
activeElement.value?.contentEditable !== "true",
|
activeElement.value?.contentEditable !== "true",
|
||||||
);
|
);
|
||||||
|
|
||||||
const backgroundImage = useSetting(SettingIds.BackgroundURL);
|
|
||||||
const canParseUrl = URL.canParse;
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
watch([n, notUsingInput, d], async () => {
|
watch([n, notUsingInput, d], async () => {
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,19 @@
|
||||||
<Transition name="slide-down">
|
<Transition name="slide-down">
|
||||||
<Alert
|
<Alert
|
||||||
v-if="profileEditor?.dirty"
|
v-if="profileEditor?.dirty"
|
||||||
class="grid grid-cols-[1fr_auto] mb-4 absolute top-4 inset-x-4 w-[calc(100%-2rem)]"
|
layout="button"
|
||||||
|
class="mb-4 absolute top-4 inset-x-4 w-[calc(100%-2rem)]"
|
||||||
>
|
>
|
||||||
<Check class="size-4" />
|
<Check class="size-4" />
|
||||||
<AlertTitle>Unsaved changes</AlertTitle>
|
<AlertTitle>Unsaved changes</AlertTitle>
|
||||||
<AlertDescription class="col-start-1">
|
<AlertDescription >
|
||||||
Click "apply" to save your changes.
|
Click "apply" to save your changes.
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
<!-- Add pl-4 because Alert is adding additional padding, which we don't want -->
|
<!-- Add pl-4 because Alert is adding additional padding, which we don't want -->
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
@click="profileEditor?.submitForm"
|
@click="profileEditor?.submitForm"
|
||||||
class="w-full col-start-2 row-start-1 row-span-2 !pl-4"
|
class="w-full !pl-4"
|
||||||
>Apply</Button
|
>Apply</Button
|
||||||
>
|
>
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="md:px-8 px-4 py-2 max-w-7xl mx-auto w-full space-y-6">
|
<div class="md:px-8 px-4 py-2 max-w-7xl mx-auto w-full space-y-6">
|
||||||
<div :class="cn('grid gap-2', canUpload && 'grid-cols-[1fr,auto]')">
|
<div :class="cn('grid gap-2', canUpload && 'grid-cols-[1fr_auto]')">
|
||||||
<h1
|
<h1
|
||||||
class="scroll-m-20 text-3xl font-extrabold tracking-tight lg:text-4xl capitalize"
|
class="scroll-m-20 text-3xl font-extrabold tracking-tight lg:text-4xl capitalize"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue