mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-28 01:09:37 +02:00
activity type overhaul
This commit is contained in:
parent
f03c338935
commit
f38062e250
6 changed files with 76 additions and 7 deletions
|
@ -20,8 +20,9 @@
|
|||
|
||||
function addActivity() {
|
||||
if (inputVal && activities) {
|
||||
if (!activities.includes(inputVal) && allActivities.includes(inputVal)) {
|
||||
activities = [...activities, inputVal];
|
||||
const trimmedInput = inputVal.trim();
|
||||
if (trimmedInput && !activities.includes(trimmedInput)) {
|
||||
activities = [...activities, trimmedInput];
|
||||
inputVal = '';
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +57,7 @@
|
|||
/>
|
||||
{#if inputVal && filteredItems.length > 0}
|
||||
<ul class="absolute z-10 w-full bg-base-100 shadow-lg max-h-60 overflow-auto">
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
{#each filteredItems as item}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<p class="text-lg ml-4 font-bold">Hi, {user.first_name} {user.last_name}</p>
|
||||
<li><button on:click={() => goto('/profile')}>Profile</button></li>
|
||||
<li><button on:click={() => goto('/adventures')}>My Adventures</button></li>
|
||||
<li><button on:click={() => goto('/activities')}>My Activities</button></li>
|
||||
<li><button on:click={() => goto('/settings')}>User Settings</button></li>
|
||||
<form method="post">
|
||||
<li><button formaction="/?/logout">Logout</button></li>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
export let type: string = 'visited';
|
||||
|
||||
import Wikipedia from '~icons/mdi/wikipedia';
|
||||
import ClipboardList from '~icons/mdi/clipboard-list';
|
||||
import ActivityComplete from './ActivityComplete.svelte';
|
||||
|
||||
let newAdventure: Adventure = {
|
||||
id: NaN,
|
||||
|
@ -218,17 +220,18 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label for="activity_types"
|
||||
>Activity Types <iconify-icon icon="mdi:clipboard-list" class="text-xl -mb-1"
|
||||
></iconify-icon></label
|
||||
<label for="activityTypes"
|
||||
>Activity Types <ClipboardList class="inline-block -mt-1 mb-1 w-6 h-6" /></label
|
||||
><br />
|
||||
<input
|
||||
type="text"
|
||||
name="activity_types"
|
||||
id="activity_types"
|
||||
name="activity_types"
|
||||
hidden
|
||||
bind:value={newAdventure.activity_types}
|
||||
class="input input-bordered w-full max-w-xs mt-1"
|
||||
/>
|
||||
<ActivityComplete bind:activities={newAdventure.activity_types} />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label for="rating"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue