Skip to content

Commit 32315d8

Browse files
committed
feat: Use svelte 5 syntax in svelte 5 template
1 parent f9cb09b commit 32315d8

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script lang="ts">
2+
import type { Snippet } from 'svelte';
3+
4+
const {
5+
title,
6+
learnMore,
7+
children,
8+
}: {
9+
title: string;
10+
learnMore: string;
11+
children: Snippet;
12+
} = $props();
13+
</script>
14+
15+
<section class="flex w-1/3 flex-col gap-2 rounded-lg bg-zinc-800 p-4 shadow-lg">
16+
<h1 class="mb-2 text-xl font-bold">{title}</h1>
17+
{@render children()}
18+
<a
19+
href={learnMore}
20+
target="_blank"
21+
rel="noreferrer"
22+
class="mt-auto pt-3 text-right text-blue-400 hover:underline"
23+
>
24+
Learn more
25+
</a>
26+
</section>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script lang="ts">
2+
import '../app.css';
3+
4+
const { children } = $props();
5+
</script>
6+
7+
{@render children()}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script lang="ts">
2+
import '../app.css';
3+
import { QueryClientProvider } from '@tanstack/svelte-query';
4+
import { trpc } from '$lib/trpc';
5+
6+
const { data, children } = $props();
7+
8+
const queryClient = trpc.hydrateFromServer(data.trpc);
9+
</script>
10+
11+
<QueryClientProvider client={queryClient}>
12+
{@render children()}
13+
</QueryClientProvider>

0 commit comments

Comments
 (0)