feat: ditch triplit, move to postgresql + drizzle orm
This commit is contained in:
@@ -7,7 +7,7 @@ const props = defineProps<{
|
||||
|
||||
type Theme = 'light' | 'dark' | 'system';
|
||||
|
||||
const { updateSettings, settings } = useUserSettings();
|
||||
const { updateSettings, settings } = await useUserSettings();
|
||||
|
||||
const selectTheme = (colorScheme: Theme) => {
|
||||
updateSettings({ appearance: { colorScheme } });
|
||||
@@ -20,7 +20,7 @@ const themeOptions: DropdownItem[] = [
|
||||
];
|
||||
|
||||
const currentOption = computed(
|
||||
() => themeOptions.find((option) => option.id === settings.value.appearance.colorScheme) || themeOptions[2],
|
||||
() => themeOptions.find((option) => option.id === settings.value?.appearance?.colorScheme) || themeOptions[2],
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -28,7 +28,7 @@ const currentOption = computed(
|
||||
<Dropdown placement="top-end" dropdown-class="min-w-35">
|
||||
<template #default="{ toggle, setRef }">
|
||||
<button :ref="setRef" @click="toggle"
|
||||
class="flex items-center justify-center rounded-lg hover:bg-[var(--color-hover)] focus-visible:bg-[var(--color-hover)] transition-colors active:text-[var(--text-primary)]"
|
||||
class="flex items-center justify-center rounded-lg @hover:bg-[var(--color-hover)] focus-visible:bg-[var(--color-hover)] transition-colors active:text-[var(--text-primary)]"
|
||||
:class="{
|
||||
'h-7 w-7 text-5': size === 'small',
|
||||
'h-9 w-9 text-6': size === 'medium',
|
||||
@@ -40,7 +40,7 @@ const currentOption = computed(
|
||||
|
||||
<template #dropdown="{ close }">
|
||||
<button v-for="option in themeOptions" :key="option.id" @click="option.onClick!(); close()"
|
||||
class="text-left px-3 py-1.5 items-center gap-1 hover:bg-[var(--color-hover)] rounded-lg transition-colors duration-150"
|
||||
class="text-left px-3 py-1.5 items-center gap-1 @hover:bg-[var(--color-hover)] rounded-lg transition-colors duration-150"
|
||||
:class="{
|
||||
'bg-[var(--color-hover)]': option.id === currentOption?.id,
|
||||
}">
|
||||
|
||||
Reference in New Issue
Block a user