mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-06-29 12:49:12 +00:00
feat: appearance form validation and update user appearance mode
This commit is contained in:
parent
af5267d97a
commit
a43f74cc7b
4 changed files with 61 additions and 7 deletions
|
@ -15,7 +15,9 @@
|
|||
import * as Form from '$lib/components/ui/form';
|
||||
import Label from '$lib/components/ui/label/label.svelte';
|
||||
import { dev } from '$app/environment';
|
||||
import type { PageData } from '../$types';
|
||||
export let data: SuperValidated<AppearanceFormSchema>;
|
||||
export let user: PageData['user'];
|
||||
</script>
|
||||
|
||||
<Form.Root
|
||||
|
@ -31,7 +33,7 @@
|
|||
<Form.Label>Theme</Form.Label>
|
||||
<Form.Description>Select the theme for the dashboard.</Form.Description>
|
||||
<Form.Validation />
|
||||
<Form.RadioGroup class="grid max-w-xl grid-cols-3 gap-8 pt-2" orientation="horizontal">
|
||||
<Form.RadioGroup class="grid max-w-xl grid-cols-3 gap-8 pt-2" orientation="horizontal" value={user?.appearanceMode}>
|
||||
<Label for="light" class="[&:has([data-state=checked])>div]:border-primary">
|
||||
<Form.RadioItem id="light" value="light" class="sr-only" />
|
||||
<div class="items-center rounded-md border-2 border-muted p-1 hover:border-accent">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue