From 74cb0ed7b9450142d81e3d8b8c5b42804fab1d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Dobrovoljc?= Date: Thu, 15 Aug 2024 00:09:24 +0200 Subject: [PATCH] Added subtitles and tab titles --- src/lib/components/Subtitle.svelte | 3 ++ src/lib/components/Title.svelte | 9 ++---- src/routes/+layout.server.ts | 2 +- src/routes/+layout.svelte | 32 ++++++++++--------- src/routes/games/[gameId]/+page.svelte | 15 +++++++++ .../games/[gameId]/draw-methods/+page.svelte | 11 ++++++- .../participation-methods/+page.svelte | 10 +++++- src/routes/games/[gameId]/prizes/+page.svelte | 11 ++++++- src/routes/games/[gameId]/users/+page.svelte | 10 +++++- .../games/[gameId]/won-prizes/+page.svelte | 10 +++++- 10 files changed, 86 insertions(+), 27 deletions(-) create mode 100644 src/lib/components/Subtitle.svelte diff --git a/src/lib/components/Subtitle.svelte b/src/lib/components/Subtitle.svelte new file mode 100644 index 0000000..018d721 --- /dev/null +++ b/src/lib/components/Subtitle.svelte @@ -0,0 +1,3 @@ +

+ +

\ No newline at end of file diff --git a/src/lib/components/Title.svelte b/src/lib/components/Title.svelte index 0634e39..8190c08 100644 --- a/src/lib/components/Title.svelte +++ b/src/lib/components/Title.svelte @@ -1,6 +1,3 @@ -
-

- -

-
- +

+ +

diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index 0f9464f..eff549b 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -6,6 +6,6 @@ export const load: LayoutServerLoad = async ({ params }) => { return { games: response.data!, - selectedGameId: params.gameId, + selectedGame: response.data?.find((game) => game.id === params.gameId), }; }; \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ce1589c..3f6dd34 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -17,7 +17,7 @@ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js'; import { Input } from '$lib/components/ui/input/index.js'; import * as Sheet from '$lib/components/ui/sheet/index.js'; - import { Gem, Gift, PartyPopper } from 'lucide-svelte'; + import { Gem, Gift, PartyPopper, Percent, TextCursorInput } from 'lucide-svelte'; import { page } from '$app/stores'; import NavItem from './NavItem.svelte'; import GameDropdown from './GameDropdown.svelte'; @@ -27,9 +27,11 @@ export let data: LayoutServerData; let path: string = 'dashboard'; + let gameSelected = false; $: { const parts = $page.url.pathname.split('/'); path = parts.length >= 4 ? parts[3] : 'dashboard'; + gameSelected = parts.length >= 3; } async function handleGameSelect(game?: Game) { @@ -49,42 +51,42 @@
- Prizer + Prizer