fixed sync locale and theme

This commit is contained in:
Martin Drechsel
2025-05-19 22:55:44 +02:00
parent 0699dbef31
commit 379db8da07
13 changed files with 3498 additions and 1846 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="dropdown relative inline-flex">
<div class="dropdown relative inline-flex" :class="dropdownClass">
<button
:id
class="dropdown-toggle"
@ -47,6 +47,7 @@ const { itemIs = 'li' } = defineProps<{
items?: T[]
itemIs?: string
activatorClass?: string
dropdownClass?: string
}>()
defineEmits<{ select: [T] }>()

View File

@ -1,6 +1,6 @@
<template>
<div>
<fieldset class="join w-full">
<fieldset class="join w-full pt-0.5">
<slot name="prepend" />
<div class="input join-item">

View File

@ -1,33 +1,12 @@
<template>
<aside
class="flex shrink-0 transition-[width] ease-in duration-300 z-30 h-full overflow-hidden fixed sm:relative left-0 shadow border-r border-base-300"
class="flex shrink-0 transition-[width] ease-in duration-300 z-30 h-full overflow-hidden fixed sm:relative left-0 shadow border-r border-base-300/90"
>
<div class="sm:flex flex-col w-14 bg-base-200 shrink-0 h-full hidden">
<img src="/logo.svg" class="bg-primary p-3 size-16" />
<div class="flex flex-col justify-between h-full overflow-y-scroll z-10">
<div class="flex flex-col space-y-2 text-base-content/90">
<template v-for="item in menu.top">
<UiSidebarLink v-if="item.to" v-bind="item" />
<UiSidebarButton v-else :icon="item.icon" :label="$t(item.label)" @click="item.click" />
</template>
</div>
<div class="flex flex-col space-y-2 text-base-content/90">
<template v-for="item in menu.bottom">
<UiSidebarLink v-if="item.to" v-bind="item" />
<UiSidebarButton v-else :icon="item.icon" :label="$t(item.label)" @click="item.click" />
</template>
<!-- <UiSidebarLink
v-for="item in menu.bottom"
:icon="item.icon"
:to="item.to ?? ''"
:label="item.label"
@click="item.click"
/> -->
</div>
<div class="flex flex-col space-y-2 text-base-content/90"></div>
</div>
</div>
@ -76,11 +55,8 @@
<script lang="ts" setup>
defineProps({
menu: {
type: Object as PropType<ISidebarMenu>,
type: Object as PropType<ISidebarItem>,
default: () => {},
},
});
//const show = ref(true);
const { show } = storeToRefs(useSidebarStore());
})
</script>

View File

@ -2,7 +2,7 @@
<li
@click="triggerNavigate"
class="hover:text-primary rounded"
:class="{ ['bg-base-300']: isActive }"
:class="{ ['bg-base-200 text-base-content']: isActive }"
>
<UiTooltip :tooltip="tooltip ?? name" direction="right-start">
<NuxtLinkLocale
@ -18,24 +18,27 @@
</template>
<script setup lang="ts">
import { type ISidebarItem } from "#imports";
import { type ISidebarItem } from '#imports'
const props = defineProps<ISidebarItem>();
const props = defineProps<ISidebarItem>()
const router = useRouter();
const router = useRouter()
console.log("to", props.to);
console.log('to', props.to)
const isActive = computed(() => {
if (props.to?.name === "haexExtension") {
return getSingleRouteParam(router.currentRoute.value.params.extensionId) === props.id;
if (props.to?.name === 'haexExtension') {
return (
getSingleRouteParam(router.currentRoute.value.params.extensionId) ===
props.id
)
} else {
return props.to?.name === router.currentRoute.value.meta.name;
return props.to?.name === router.currentRoute.value.meta.name
}
});
})
const linkRef = useTemplateRef("linkRef");
const linkRef = useTemplateRef('linkRef')
const triggerNavigate = () => linkRef.value?.$el.click();
const triggerNavigate = () => linkRef.value?.$el.click()
/* computed(() => {
const found = useRouter()