1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 12:59:36 +02:00

chore: Update Navbar component with search form

This commit is contained in:
Sean Morley 2024-07-20 08:39:32 -04:00
parent c6633a17cb
commit f44a6a2dfd
5 changed files with 53 additions and 45 deletions

View file

@ -83,25 +83,6 @@
<li>
<button on:click={() => goto('/map')}>Map</button>
</li>
<form class="flex gap-2">
<label class="input input-bordered flex items-center gap-2">
<input type="text" bind:value={query} class="grow" placeholder="Search" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="h-4 w-4 opacity-70"
>
<path
fill-rule="evenodd"
d="M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"
clip-rule="evenodd"
/>
</svg>
</label>
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
</form>
{/if}
{#if !data.user}
@ -112,6 +93,26 @@
<button class="btn btn-primary" on:click={() => goto('/signup')}>Signup</button>
</li>
{/if}
<form class="flex gap-2">
<label class="input input-bordered flex items-center gap-2">
<input type="text" bind:value={query} class="grow" placeholder="Search" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="h-4 w-4 opacity-70"
>
<path
fill-rule="evenodd"
d="M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"
clip-rule="evenodd"
/>
</svg>
</label>
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
</form>
</ul>
</div>
<a class="btn btn-ghost text-xl" href="/"
@ -134,25 +135,6 @@
<li>
<button class="btn btn-neutral" on:click={() => goto('/map')}>Map</button>
</li>
<form class="flex gap-2">
<label class="input input-bordered flex items-center gap-2">
<input type="text" bind:value={query} class="grow" placeholder="Search" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="h-4 w-4 opacity-70"
>
<path
fill-rule="evenodd"
d="M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"
clip-rule="evenodd"
/>
</svg>
</label>
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
</form>
{/if}
{#if !data.user}
@ -163,6 +145,26 @@
<button class="btn btn-primary" on:click={() => goto('/signup')}>Signup</button>
</li>
{/if}
<form class="flex gap-2">
<label class="input input-bordered flex items-center gap-2">
<input type="text" bind:value={query} class="grow" placeholder="Search" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="h-4 w-4 opacity-70"
>
<path
fill-rule="evenodd"
d="M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"
clip-rule="evenodd"
/>
</svg>
</label>
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
</form>
</ul>
</div>
<div class="navbar-end">

View file

@ -27,7 +27,8 @@
user_id: NaN,
latitude: null,
longitude: null,
is_public: false
is_public: false,
collection: null
};
let image: File;

View file

@ -1,4 +1,4 @@
export let appVersion = 'Web v0.4.0';
export let versionChangelog = 'https://github.com/seanmorley15/AdventureLog/releases/tag/v0.4.0';
export let appVersion = 'Web v0.4.1';
export let versionChangelog = 'https://github.com/seanmorley15/AdventureLog/releases/tag/v0.4.1';
export let appTitle = 'AdventureLog';
export let copyrightYear = '2024';

View file

@ -20,8 +20,6 @@
let resultsPerPage: number = 10;
let currentView: string = 'cards';
let next: string | null = data.props.next || null;
let previous: string | null = data.props.previous || null;
let count = data.props.count || 0;

View file

@ -13,6 +13,7 @@
}
let osmResults: OpenStreetMapPlace[] = [];
let adventures: Adventure[] = [];
let query: string | null = '';
@ -36,7 +37,7 @@
});
console.log(data);
let adventures: Adventure[] = [];
if (data.props) {
adventures = data.props.adventures;
}
@ -44,7 +45,9 @@
{#if adventures.length === 0 && osmResults.length === 0}
<NotFound error={data.error} />
{:else}
{/if}
{#if adventures.length > 0}
<h2 class="text-center font-bold text-2xl mb-4">AdventureLog Results</h2>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each adventures as adventure}
@ -56,7 +59,11 @@
/>
{/each}
</div>
{/if}
{#if adventures.length > 0 && osmResults.length > 0}
<div class="divider"></div>
{/if}
{#if osmResults.length > 0}
<h2 class="text-center font-bold text-2xl mb-4">Online Results</h2>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each osmResults as result}