mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
feat: ✨ Add sidebar style setting
This commit is contained in:
parent
e26d23610f
commit
8626a15076
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Sidebar variant="inset" collapsible="icon">
|
<Sidebar :variant="(sidebarStyle.value as 'sidebar' | 'floating' | 'inset')" collapsible="icon">
|
||||||
<SidebarHeader>
|
<SidebarHeader>
|
||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
|
|
@ -119,10 +119,13 @@ import {
|
||||||
SidebarMenuSubItem,
|
SidebarMenuSubItem,
|
||||||
SidebarRail,
|
SidebarRail,
|
||||||
} from "~/components/ui/sidebar";
|
} from "~/components/ui/sidebar";
|
||||||
|
import { type EnumSetting, SettingIds } from "~/settings";
|
||||||
import Avatar from "../profiles/avatar.vue";
|
import Avatar from "../profiles/avatar.vue";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import AccountSwitcher from "./account-switcher.vue";
|
import AccountSwitcher from "./account-switcher.vue";
|
||||||
|
|
||||||
|
const sidebarStyle = useSetting(SettingIds.SidebarStyle) as Ref<EnumSetting>;
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
navMain: [
|
navMain: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
22
settings.ts
22
settings.ts
|
|
@ -82,6 +82,7 @@ export enum SettingIds {
|
||||||
BackgroundURL = "background-url",
|
BackgroundURL = "background-url",
|
||||||
NotificationsSidebar = "notifications-sidebar",
|
NotificationsSidebar = "notifications-sidebar",
|
||||||
AvatarShape = "avatar-shape",
|
AvatarShape = "avatar-shape",
|
||||||
|
SidebarStyle = "sidebar-style",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const settings: Record<SettingIds, Setting> = {
|
export const settings: Record<SettingIds, Setting> = {
|
||||||
|
|
@ -93,6 +94,27 @@ export const settings: Record<SettingIds, Setting> = {
|
||||||
page: SettingPages.Behaviour,
|
page: SettingPages.Behaviour,
|
||||||
notImplemented: true,
|
notImplemented: true,
|
||||||
} as BooleanSetting,
|
} as BooleanSetting,
|
||||||
|
[SettingIds.SidebarStyle]: {
|
||||||
|
title: "Sidebar Style",
|
||||||
|
description: "Style of the left sidebar.",
|
||||||
|
type: SettingType.Enum,
|
||||||
|
value: "inset",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: "inset",
|
||||||
|
label: "Inset",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "sidebar",
|
||||||
|
label: "Sidebar",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "floating",
|
||||||
|
label: "Floating",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
page: SettingPages.Appearance,
|
||||||
|
} as EnumSetting,
|
||||||
[SettingIds.AvatarShape]: {
|
[SettingIds.AvatarShape]: {
|
||||||
title: "Avatar Shape",
|
title: "Avatar Shape",
|
||||||
description: "Shape of all user avatars.",
|
description: "Shape of all user avatars.",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue