mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-20 13:29:37 +02:00
chore: Update Navbar component with search form
This commit is contained in:
parent
c6633a17cb
commit
f44a6a2dfd
5 changed files with 53 additions and 45 deletions
|
@ -83,6 +83,17 @@
|
||||||
<li>
|
<li>
|
||||||
<button on:click={() => goto('/map')}>Map</button>
|
<button on:click={() => goto('/map')}>Map</button>
|
||||||
</li>
|
</li>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if !data.user}
|
||||||
|
<li>
|
||||||
|
<button class="btn btn-primary" on:click={() => goto('/login')}>Login</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button class="btn btn-primary" on:click={() => goto('/signup')}>Signup</button>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<form class="flex gap-2">
|
<form class="flex gap-2">
|
||||||
<label class="input input-bordered flex items-center gap-2">
|
<label class="input input-bordered flex items-center gap-2">
|
||||||
<input type="text" bind:value={query} class="grow" placeholder="Search" />
|
<input type="text" bind:value={query} class="grow" placeholder="Search" />
|
||||||
|
@ -102,16 +113,6 @@
|
||||||
</label>
|
</label>
|
||||||
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
|
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if !data.user}
|
|
||||||
<li>
|
|
||||||
<button class="btn btn-primary" on:click={() => goto('/login')}>Login</button>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<button class="btn btn-primary" on:click={() => goto('/signup')}>Signup</button>
|
|
||||||
</li>
|
|
||||||
{/if}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<a class="btn btn-ghost text-xl" href="/"
|
<a class="btn btn-ghost text-xl" href="/"
|
||||||
|
@ -134,6 +135,17 @@
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-neutral" on:click={() => goto('/map')}>Map</button>
|
<button class="btn btn-neutral" on:click={() => goto('/map')}>Map</button>
|
||||||
</li>
|
</li>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if !data.user}
|
||||||
|
<li>
|
||||||
|
<button class="btn btn-primary" on:click={() => goto('/login')}>Login</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button class="btn btn-primary" on:click={() => goto('/signup')}>Signup</button>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<form class="flex gap-2">
|
<form class="flex gap-2">
|
||||||
<label class="input input-bordered flex items-center gap-2">
|
<label class="input input-bordered flex items-center gap-2">
|
||||||
<input type="text" bind:value={query} class="grow" placeholder="Search" />
|
<input type="text" bind:value={query} class="grow" placeholder="Search" />
|
||||||
|
@ -153,16 +165,6 @@
|
||||||
</label>
|
</label>
|
||||||
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
|
<button on:click={searchGo} type="submit" class="btn btn-neutral">Search</button>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if !data.user}
|
|
||||||
<li>
|
|
||||||
<button class="btn btn-primary" on:click={() => goto('/login')}>Login</button>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<button class="btn btn-primary" on:click={() => goto('/signup')}>Signup</button>
|
|
||||||
</li>
|
|
||||||
{/if}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
user_id: NaN,
|
user_id: NaN,
|
||||||
latitude: null,
|
latitude: null,
|
||||||
longitude: null,
|
longitude: null,
|
||||||
is_public: false
|
is_public: false,
|
||||||
|
collection: null
|
||||||
};
|
};
|
||||||
|
|
||||||
let image: File;
|
let image: File;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export let appVersion = 'Web v0.4.0';
|
export let appVersion = 'Web v0.4.1';
|
||||||
export let versionChangelog = 'https://github.com/seanmorley15/AdventureLog/releases/tag/v0.4.0';
|
export let versionChangelog = 'https://github.com/seanmorley15/AdventureLog/releases/tag/v0.4.1';
|
||||||
export let appTitle = 'AdventureLog';
|
export let appTitle = 'AdventureLog';
|
||||||
export let copyrightYear = '2024';
|
export let copyrightYear = '2024';
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
let resultsPerPage: number = 10;
|
let resultsPerPage: number = 10;
|
||||||
|
|
||||||
let currentView: string = 'cards';
|
|
||||||
|
|
||||||
let next: string | null = data.props.next || null;
|
let next: string | null = data.props.next || null;
|
||||||
let previous: string | null = data.props.previous || null;
|
let previous: string | null = data.props.previous || null;
|
||||||
let count = data.props.count || 0;
|
let count = data.props.count || 0;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let osmResults: OpenStreetMapPlace[] = [];
|
let osmResults: OpenStreetMapPlace[] = [];
|
||||||
|
let adventures: Adventure[] = [];
|
||||||
|
|
||||||
let query: string | null = '';
|
let query: string | null = '';
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(data);
|
console.log(data);
|
||||||
let adventures: Adventure[] = [];
|
|
||||||
if (data.props) {
|
if (data.props) {
|
||||||
adventures = data.props.adventures;
|
adventures = data.props.adventures;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +45,9 @@
|
||||||
|
|
||||||
{#if adventures.length === 0 && osmResults.length === 0}
|
{#if adventures.length === 0 && osmResults.length === 0}
|
||||||
<NotFound error={data.error} />
|
<NotFound error={data.error} />
|
||||||
{:else}
|
{/if}
|
||||||
|
|
||||||
|
{#if adventures.length > 0}
|
||||||
<h2 class="text-center font-bold text-2xl mb-4">AdventureLog Results</h2>
|
<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">
|
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||||
{#each adventures as adventure}
|
{#each adventures as adventure}
|
||||||
|
@ -56,7 +59,11 @@
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
{#if adventures.length > 0 && osmResults.length > 0}
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
{/if}
|
||||||
|
{#if osmResults.length > 0}
|
||||||
<h2 class="text-center font-bold text-2xl mb-4">Online Results</h2>
|
<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">
|
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||||
{#each osmResults as result}
|
{#each osmResults as result}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue