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 { ref, computed, defineAsyncComponent } from "vue";
|
||||
import Header from "@/components/text/Header.vue";
|
||||
import Modal from "@/components/util/Modal.vue";
|
||||
import CreateToggle from "@/components/input/CreateToggle.vue";
|
||||
import { useHomeDataStore } from "@/stores/homeData";
|
||||
import { storeToRefs } from "pinia";
|
||||
@@ -116,17 +117,14 @@ function formatValue(key, val) {
|
||||
<template>
|
||||
<div class="flex flex-col h-full overflow-hidden">
|
||||
<Header>
|
||||
{{ showCreate ? "Upload Rowing" : "Rowing" }}
|
||||
Rowing
|
||||
<template #action><CreateToggle v-model="showCreate" /></template>
|
||||
</Header>
|
||||
|
||||
<CreateRowing
|
||||
v-if="showCreate"
|
||||
class="flex-1 p-1"
|
||||
@done="showCreate = false"
|
||||
@cancel="showCreate = false"
|
||||
/>
|
||||
<div v-else-if="loading" class="flex-1 flex items-center justify-center">
|
||||
<Modal v-model="showCreate">
|
||||
<CreateRowing @done="showCreate = false" @cancel="showCreate = false" />
|
||||
</Modal>
|
||||
<div v-if="loading" class="flex-1 flex items-center justify-center">
|
||||
<p>Loading...</p>
|
||||
</div>
|
||||
<div v-else-if="error" class="flex-1 flex items-center justify-center">
|
||||
|
||||
Reference in New Issue
Block a user