From aa9ed774991b0ca0618fffe390b9abade5b6ea43 Mon Sep 17 00:00:00 2001 From: Zias van Nes Date: Tue, 21 Oct 2025 14:44:25 +0200 Subject: [PATCH] UI:Refactor create find modal UI and update finds list/header layout - Replace Modal with Sheet for create find modal - Redesign form fields and file upload UI - Add responsive mobile support for modal - Update FindsList to support optional title hiding - Move finds section header to sticky header in main page - Adjust styles for improved layout and responsiveness --- src/lib/components/CreateFindModal.svelte | 513 ++++++++++++---------- src/lib/components/FindsList.svelte | 13 +- src/routes/+page.svelte | 83 ++-- 3 files changed, 353 insertions(+), 256 deletions(-) diff --git a/src/lib/components/CreateFindModal.svelte b/src/lib/components/CreateFindModal.svelte index 69b6585..d4a1560 100644 --- a/src/lib/components/CreateFindModal.svelte +++ b/src/lib/components/CreateFindModal.svelte @@ -1,7 +1,8 @@ {#if isOpen} - - {#snippet header()} -

Create Find

- {/snippet} + (showModal = open)}> + + + Create Find + -
{ e.preventDefault(); handleSubmit(); }} + class="form" > -
- - - {title.length}/100 -
- -
- - - {description.length}/500 -
- -
- - -
- -
-
- - +
+
+ +
-
- - + +
+ +
-
-
- - -
+
+ + +
-
- - - {#if selectedFiles && selectedFiles.length > 0} -
- {#each Array.from(selectedFiles) as file (file.name)} - {file.name} - {/each} +
+
+ +
- {/if} +
+ + +
+
+ +
+ +
+ +
+ + + + + Click to upload +
+
+ {#if selectedFiles && selectedFiles.length > 0} +
+ + + + + {selectedFiles[0].name} +
+ {/if} +
+ +
+
+ + +
+
+ + +
+
-
- -

- {isPublic ? 'Everyone can see this find' : 'Only your friends can see this find'} -

-
- -
- +
-
- + + {/if} diff --git a/src/lib/components/FindsList.svelte b/src/lib/components/FindsList.svelte index ff0ae80..564ca0e 100644 --- a/src/lib/components/FindsList.svelte +++ b/src/lib/components/FindsList.svelte @@ -26,6 +26,7 @@ title?: string; showEmpty?: boolean; emptyMessage?: string; + hideTitle?: boolean; } let { @@ -33,7 +34,8 @@ onFindExplore, title = 'Finds', showEmpty = true, - emptyMessage = 'No finds to display' + emptyMessage = 'No finds to display', + hideTitle = false }: FindsListProps = $props(); function handleFindExplore(id: string) { @@ -42,9 +44,11 @@
-
-

{title}

-
+ {#if !hideTitle} +
+

{title}

+
+ {/if} {#if finds.length > 0}
@@ -98,6 +102,7 @@