diff --git a/src/lib/components/chapter.svelte b/src/lib/components/chapter.svelte
index f447d25..476b455 100644
--- a/src/lib/components/chapter.svelte
+++ b/src/lib/components/chapter.svelte
@@ -12,21 +12,21 @@
class={cn(
'group relative flex h-full w-full flex-col rounded border border-border bg-card transition-colors duration-150',
{
- 'hover:bg-card/80': chapter.show,
- 'opacity-50': !chapter.show
+ 'hover:bg-card/80': chapter.show || (chapter.start && chapter.end),
+ 'opacity-50': !chapter.show && !(chapter.start && chapter.end)
}
)}
>
- {#if chapter.show}
+ {#if chapter.show || (chapter.start && chapter.end)}
{chapter.name}
- {#if chapter.id === 1}
+ {#if chapter.start && chapter.end}
{/if}
diff --git a/src/lib/components/layout/navbar/navbar-user.svelte b/src/lib/components/layout/navbar/navbar-user.svelte
index 43b65bb..1222150 100644
--- a/src/lib/components/layout/navbar/navbar-user.svelte
+++ b/src/lib/components/layout/navbar/navbar-user.svelte
@@ -9,6 +9,9 @@
import LogOut from 'lucide-svelte/icons/log-out';
import Settings from 'lucide-svelte/icons/settings';
import Users from 'lucide-svelte/icons/users';
+ import Shield from 'lucide-svelte/icons/shield';
+ import ScrollText from 'lucide-svelte/icons/scroll-text';
+ import Code from 'lucide-svelte/icons/code';
import * as Avatar from '$lib/components/ui/avatar';
import { Button } from '$lib/components/ui/button';
@@ -33,6 +36,29 @@
Salutation, {$page.data.user?.pseudo}
+ {#if $page.data.user?.email.endsWith('@peerat.dev')}
+
+
+
+
+ Administration
+
+
+
+
+ Logs
+
+
+
+ Chapitres
+
+
+
+ Puzzles
+
+
+
+ {/if}
@@ -43,10 +69,10 @@
Mes badges
-
+
diff --git a/src/lib/types/database.ts b/src/lib/types/database.ts
index d2267ad..d90eeb3 100644
--- a/src/lib/types/database.ts
+++ b/src/lib/types/database.ts
@@ -49,6 +49,8 @@ export interface Chapter {
name: string;
puzzles: Puzzle[];
show?: boolean;
+ start?: string;
+ end?: string;
}
export interface Tag {
diff --git a/src/lib/validations/group.ts b/src/lib/validations/group.ts
new file mode 100644
index 0000000..0d7a427
--- /dev/null
+++ b/src/lib/validations/group.ts
@@ -0,0 +1,8 @@
+import { z } from 'zod';
+
+export const groupSchema = z.object({
+ name: z.string({
+ required_error: 'Un nom est requis',
+ })
+ .min(1, 'Un nom est requis',),
+});
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte
index 686bac7..f7c759e 100644
--- a/src/routes/(app)/+layout.svelte
+++ b/src/routes/(app)/+layout.svelte
@@ -2,6 +2,7 @@
import { navigating } from '$app/stores';
import { Loader, Navbar, Sidenav } from '$lib/components/layout';
+ import { Toaster } from '$lib/components/ui/sonner';
{#if $navigating}
@@ -17,6 +18,7 @@
class="flex w-full flex-1 transform flex-col overflow-y-auto p-4 duration-300 ease-in-out"
>
+
diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte
index d6d1d5c..01936b9 100644
--- a/src/routes/(app)/+page.svelte
+++ b/src/routes/(app)/+page.svelte
@@ -2,6 +2,7 @@
import type { PageData } from './$types';
import Card from '$lib/components/card.svelte';
+ import Button from '$lib/components/ui/button/button.svelte';
export let data: PageData;
@@ -29,7 +30,7 @@
{data.daily.chapter.name}
@@ -37,13 +38,9 @@
{data.daily.puzzle.name} ({data.daily.puzzle.score ?? '?'}/{data.daily.puzzle.scoreMax})
-
+
{/if}
-