Open home widget create forms in popup modals
The Places tab already popped its create form up over the page; every other /stp widget swapped its contents for the form instead, which meant losing sight of the list you were adding to and a cramped form inside a grid cell. Extract the Places modal into a shared components/util/Modal.vue (teleported backdrop, click-outside and Escape to close) and use it for the Feed, Bookmarks, Favorites, Consumption and Rowing create forms as well. Widget headers keep their normal titles now that each form carries its own heading in the modal. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KcFtkisHcKJuTZAnv3fVzA
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { computed, ref, defineAsyncComponent } from "vue";
|
||||
import LinkTable from "@/components/util/LinkTable.vue";
|
||||
import Modal from "@/components/util/Modal.vue";
|
||||
import Header from "@/components/text/Header.vue";
|
||||
import CreateToggle from "@/components/input/CreateToggle.vue";
|
||||
import { useHomeDataStore } from "@/stores/homeData";
|
||||
@@ -26,16 +27,10 @@ const groupedBookmarks = computed(() => {
|
||||
<template>
|
||||
<div class="bookmarks-wrapper">
|
||||
<Header class="text-left">
|
||||
{{ showCreate ? "Create Bookmark" : "Bookmarks" }}
|
||||
Bookmarks
|
||||
<template #action><CreateToggle v-model="showCreate" /></template>
|
||||
</Header>
|
||||
<CreateBookmark
|
||||
v-if="showCreate"
|
||||
class="flex-1 min-h-0 p-1"
|
||||
@done="showCreate = false"
|
||||
@cancel="showCreate = false"
|
||||
/>
|
||||
<div v-if="!showCreate" class="bookmarks-scroll">
|
||||
<div class="bookmarks-scroll">
|
||||
<LinkTable
|
||||
v-for="group in groupedBookmarks"
|
||||
:key="group[0]"
|
||||
@@ -43,6 +38,12 @@ const groupedBookmarks = computed(() => {
|
||||
:items="group[1]"
|
||||
/>
|
||||
</div>
|
||||
<Modal v-model="showCreate">
|
||||
<CreateBookmark
|
||||
@done="showCreate = false"
|
||||
@cancel="showCreate = false"
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user