Skip to content

Commit 0aaedff

Browse files
authored
Fix small UI bugs (#1260)
* Refactor `NoteList` * Refactor `VideoList` * Refactor `PostList`
1 parent fb9d799 commit 0aaedff

14 files changed

Lines changed: 196 additions & 196 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
"@fontsource/lexend": "^5.2.11",
2323
"@fontsource/spectral": "^5.2.8",
2424
"@lucide/svelte": "^1.21.0",
25-
"@maiertech/sveltekit-helpers": "^0.53.2",
25+
"@maiertech/sveltekit-helpers": "^0.54.0",
2626
"@playwright/test": "^1.61.0",
2727
"@skeletonlabs/skeleton": "^4.15.2",
2828
"@skeletonlabs/skeleton-svelte": "^4.15.2",
2929
"@stackblitz/sdk": "^1.11.0",
3030
"@sveltejs/adapter-node": "5.5.4",
3131
"@sveltejs/enhanced-img": "^0.11.0",
32-
"@sveltejs/kit": "2.65.2",
32+
"@sveltejs/kit": "^2.66.0",
3333
"@sveltejs/vite-plugin-svelte": "^7.1.2",
3434
"@tailwindcss/vite": "^4.3.1",
35-
"@types/node": "^25.9.3",
35+
"@types/node": "^25.9.4",
3636
"d3-array": "^3.2.4",
3737
"dotenv": "^17.4.2",
3838
"eslint": "^10.5.0",

pnpm-lock.yaml

Lines changed: 172 additions & 172 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/NoteList.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
55
interface Props {
66
values: Note[];
7-
level: 1 | 2 | 3 | 4 | 5 | 6;
7+
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
88
class?: string;
99
}
1010
11-
let { values, level, class: className }: Props = $props();
11+
let { values, as, class: className }: Props = $props();
1212
</script>
1313

1414
<div data-component="NoteList" class={twMerge(className, 'flex flex-wrap gap-6')}>
1515
{#each values as note (note.path)}
16-
<NotePreview value={note} {level} class="grow basis-2xs" />
16+
<NotePreview value={note} {as} class="grow basis-2xs" />
1717
{/each}
1818
</div>

src/lib/components/PostList.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
55
interface Props {
66
values: Post[];
7-
level: 1 | 2 | 3 | 4 | 5 | 6;
7+
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
88
class?: string;
99
}
1010
11-
let { values, level, class: className }: Props = $props();
11+
let { values, as, class: className }: Props = $props();
1212
</script>
1313

1414
<div data-component="PostList" class={twMerge(className, 'flex flex-wrap gap-6')}>
1515
{#each values as post (post.path)}
16-
<PostPreview value={post} {level} class="grow basis-xs" />
16+
<PostPreview value={post} {as} class="grow basis-xs" />
1717
{/each}
1818
</div>

src/lib/components/VideoList.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
55
interface Props {
66
values: Video[];
7-
level: 1 | 2 | 3 | 4 | 5 | 6;
7+
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
88
class?: string;
99
}
1010
11-
let { values, level, class: className }: Props = $props();
11+
let { values, as, class: className }: Props = $props();
1212
</script>
1313

1414
<div data-component="VideoList" class={twMerge(className, 'flex flex-wrap gap-6')}>
1515
{#each values as video (video.id)}
16-
<VideoPreview value={video} {level} showDescription={false} class="grow basis-xs" />
16+
<VideoPreview value={video} {as} showDescription={false} class="grow basis-xs" />
1717
{/each}
1818
</div>

src/routes/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323

2424
<div class="mb-8 flex flex-wrap gap-6">
2525
<!-- Not-sidebar (videos): latest video. -->
26-
<VideoPreview value={data.videos[0]} level={3} class="grow-999 min-inline-3/5" />
26+
<VideoPreview value={data.videos[0]} as="h3" class="grow-999 min-inline-3/5" />
2727

2828
<!-- Sidebar (videos): 2 more videos. -->
2929
<div class="flex grow basis-3xs flex-wrap gap-6">
3030
{#each data.videos.slice(1) as video (video.id)}
31-
<VideoPreview value={video} level={3} showDescription={false} class="grow basis-80" />
31+
<VideoPreview value={video} as="h3" showDescription={false} class="grow basis-80" />
3232
{/each}
3333
</div>
3434
</div>
@@ -38,7 +38,7 @@
3838
<span class="text-lg font-semibold">Latest posts</span>
3939
</h2>
4040

41-
<PostList values={data.posts} level={3} />
41+
<PostList values={data.posts} as="h3" />
4242
</div>
4343

4444
<!-- Sidebar (outer): notes. -->
@@ -48,6 +48,6 @@
4848
<span class="text-lg font-semibold">Latest notes</span>
4949
</h2>
5050

51-
<NoteList values={data.notes} level={3} />
51+
<NoteList values={data.notes} as="h3" />
5252
</div>
5353
</div>

src/routes/guides/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
<Clock class="size-5" />
2424
<span class="text-lg font-semibold">Latest videos</span>
2525
</h2>
26-
<VideoList values={data.recommendedVideos} level={3} />
26+
<VideoList values={data.recommendedVideos} as="h3" />
2727
</aside>
2828
</div>

src/routes/notes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
<Clock class="size-5" />
2424
<span class="text-lg font-semibold">Latest videos</span>
2525
</h2>
26-
<VideoList values={data.recommendedVideos} level={3} />
26+
<VideoList values={data.recommendedVideos} as="h3" />
2727
</aside>
2828
</div>

src/routes/notes/+page@.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
<H1 class="mb-8">{data.seo.title}</H1>
1010

11-
<NoteList values={data.notes} level={2} />
11+
<NoteList values={data.notes} as="h2" />

src/routes/posts/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
<Clock class="size-5" />
2525
<span class="text-lg font-semibold">Latest videos</span>
2626
</h2>
27-
<VideoList values={data.recommendedVideos} level={3} />
27+
<VideoList values={data.recommendedVideos} as="h3" />
2828
</aside>
2929
</div>

0 commit comments

Comments
 (0)