Skip to content

Commit f4eccff

Browse files
refactor: enhance component structure and styling for better usability
- Updated the 'Row' component to simplify class usage. - Added an optional 'id' prop to the 'Section' component for improved accessibility. - Changed the 'Logo' component to use a 'div' wrapper and updated link structure for better navigation. - Incorporated an 'id' for the version section in the about page for improved linking.
1 parent 75dcded commit f4eccff

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/lib/components/about/row.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{/if}
2020
</div>
2121
<div class="flex items-center justify-start px-3 py-2 bg-neutral-950/30 border-t border-neutral-800">
22-
<span class="text-neutral-400 font-mono text-xs">
22+
<span class="text-neutral-400 text-xs">
2323
{#if value}
2424
{value}
2525
{/if}

src/lib/components/about/section.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
title: string;
88
description?: string;
99
children?: Snippet;
10+
id?: string;
1011
class?: string;
1112
};
1213
13-
let { title, description, children, class: className }: Props = $props();
14+
let { title, description, children, id, class: className }: Props = $props();
1415
</script>
1516

16-
<div class="flex flex-col gap-4">
17+
<div class="flex flex-col gap-4" {id}>
1718
<div class="flex flex-col gap-4">
1819
<h3 class="text-neutral-400 text-xs uppercase tracking-wider">
1920
{title}

src/lib/components/ui/logo.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
};
2222
</script>
2323

24-
<a href="/" class={cn(
24+
<div class={cn(
2525
"font-medium text-neutral-100 flex items-center gap-2",
2626
sizeClasses[size],
2727
className
2828
)}>
29-
<span>{"{"} 🍯 Data Viewer {"}"}</span>
29+
<a href="/">
30+
<span>{"{"} 🍯 Data Viewer {"}"}</span>
31+
</a>
3032
{#if version}
31-
<span class="text-yellow-400/50 text-xs">v{version}</span>
33+
<a href="/about#version" class="text-yellow-400/70 hover:text-yellow-400 text-xs">v{version}</a>
3234
{/if}
33-
</a>
35+
</div>
3436

src/routes/(content)/about/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484

8585
<Section
8686
title="VERSION INFO"
87+
id="version"
8788
class="grid grid-cols-1 gap-4 text-xs w-full"
8889
>
8990
<Row

0 commit comments

Comments
 (0)