Skip to content

Commit

Permalink
chore: update notes form
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed Jan 26, 2024
1 parent 883b4d8 commit 2ab7fe8
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions pages/notes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,45 @@ const items = [[{
>
<span class="flex-1 font-medium">{{ entry.key }}</span>
<span v-if="editedEntryKey !== entry.key" class="flex-1 font-medium">{{ entry.value }}</span>
<UInput v-else v-model="editedEntryValue" name="editedValue" variant="none" size="xl" autofocus :padded="false" class="flex-1" @keypress.enter="updateEntry(entry)" />
<UButton
v-if="editedEntryKey !== entry.key"
variant="ghost"
size="2xs"
icon="i-heroicons-pencil"
class="flex-shrink-0"
@click="editEntry(entry)"
/>
<UButton
v-else
variant="ghost"
size="2xs"
icon="i-heroicons-x-mark"
class="flex-shrink-0"
@click="editedEntryKey = null"
/>
<div class="flex-1 flex items-center">
<span v-if="editedEntryKey !== entry.key" class="flex-1 font-medium">{{ entry.value }}</span>
<UInput
v-else
v-model="editedEntryValue"
name="editedValue"
variant="none"
size="xl"
autofocus
:padded="false"
class="flex-1"
@keydown.enter="updateEntry(entry)"
@keydown.esc="editedEntryKey = null"
/>
<UButton
v-if="editedEntryKey !== entry.key"
variant="ghost"
size="2xs"
icon="i-heroicons-pencil"
class="flex-shrink-0"
@click="editEntry(entry)"
/>
<div v-else class="flex-shrink-0 flex gap-1">
<UButton
variant="ghost"
size="2xs"
icon="i-heroicons-check"
@click="updateEntry(entry)"
/>
<UButton
variant="ghost"
size="2xs"
icon="i-heroicons-x-mark"
@click="editedEntryKey = null"
/>
</div>
</div>
<UButton
color="red"
Expand Down

0 comments on commit 2ab7fe8

Please sign in to comment.