-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use svelte 5 syntax in svelte 5 template
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
template_builder/templates/extras/src/lib/components/{Svelte5}NextStep.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script lang="ts"> | ||
import type { Snippet } from 'svelte'; | ||
const { | ||
title, | ||
learnMore, | ||
children, | ||
}: { | ||
title: string; | ||
learnMore: string; | ||
children: Snippet; | ||
} = $props(); | ||
</script> | ||
|
||
<section class="flex w-1/3 flex-col gap-2 rounded-lg bg-zinc-800 p-4 shadow-lg"> | ||
<h1 class="mb-2 text-xl font-bold">{title}</h1> | ||
{@render children()} | ||
<a | ||
href={learnMore} | ||
target="_blank" | ||
rel="noreferrer" | ||
class="mt-auto pt-3 text-right text-blue-400 hover:underline" | ||
> | ||
Learn more | ||
</a> | ||
</section> |
7 changes: 7 additions & 0 deletions
7
template_builder/templates/extras/src/routes/{Svelte5}+layout.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script lang="ts"> | ||
import '../app.css'; | ||
const { children } = $props(); | ||
</script> | ||
|
||
{@render children()} |
13 changes: 13 additions & 0 deletions
13
template_builder/templates/extras/src/routes/{Trpc,Svelte5}+layout.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import '../app.css'; | ||
import { QueryClientProvider } from '@tanstack/svelte-query'; | ||
import { trpc } from '$lib/trpc'; | ||
const { data, children } = $props(); | ||
const queryClient = trpc.hydrateFromServer(data.trpc); | ||
</script> | ||
|
||
<QueryClientProvider client={queryClient}> | ||
{@render children()} | ||
</QueryClientProvider> |