Skip to content

Commit dc73739

Browse files
committed
fix: optimize navbar
1 parent 086c7a6 commit dc73739

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

frontend/src/lib/components/Navbar.svelte

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<nav class="block w-full sm:mt-3 mb-6">
3636
<div class="flex flex-col items-center w-full sm:max-w-[500px] sm:mx-auto bg-background">
3737
<div
38-
class="flex justify-between sm:justify-around w-full px-2 sm:px-6 py-2 sm:py-4 sm:rounded-2xl shadow-md sm:border"
38+
class="flex justify-between sm:justify-around w-full px-4 sm:px-6 py-2 sm:py-4 sm:rounded-2xl shadow-md sm:border"
3939
>
4040
<img src="/icon-96.png" alt="icon" class="w-10" />
4141
<div class="hidden sm:block">
@@ -51,20 +51,20 @@
5151
</div>
5252
<ThemeToggler className="hidden sm:flex" />
5353
<Button
54-
variant="ghost"
54+
variant="outline"
5555
size="icon"
5656
on:click={() => (showMenu = !showMenu)}
5757
class="flex sm:hidden"
5858
>
5959
{#if showMenu}
60-
<XIcon size="15" />
60+
<XIcon />
6161
{:else}
62-
<MenuIcon size="15" />
62+
<MenuIcon />
6363
{/if}
6464
</Button>
6565
</div>
6666

67-
<div class="relative w-full">
67+
<div class="sm:hidden relative w-full z-[9999]">
6868
{#if showMenu}
6969
<div class="flex flex-col w-full absolute top-0 bg-background shadow-md">
7070
{#each links as l}

frontend/src/lib/components/ui/input/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type InputEvents = {
1818
mouseleave: FormInputEvent<MouseEvent>;
1919
paste: FormInputEvent<ClipboardEvent>;
2020
input: FormInputEvent<InputEvent>;
21+
wheel: FormInputEvent<WheelEvent>;
2122
};
2223

2324
export {

frontend/src/lib/components/ui/input/input.svelte

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
let className: $$Props["class"] = undefined;
1010
export let value: $$Props["value"] = undefined;
1111
export { className as class };
12+
13+
// Workaround for https://github.com/sveltejs/svelte/issues/9305
14+
// Fixed in Svelte 5, but not backported to 4.x.
15+
export let readonly: $$Props["readonly"] = undefined;
1216
</script>
1317

1418
<input
@@ -17,6 +21,7 @@
1721
className
1822
)}
1923
bind:value
24+
{readonly}
2025
on:blur
2126
on:change
2227
on:click
@@ -31,5 +36,6 @@
3136
on:mouseleave
3237
on:paste
3338
on:input
39+
on:wheel
3440
{...$$restProps}
3541
/>

0 commit comments

Comments
 (0)