mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 09:38:54 +00:00
feat(places): one place view for All places and the lists
The desktop dialog and the phone sheet of a place show its overview, notes, tours and bookings, photos and files and its history in tabs, with the tags of each list and trip, a markdown notes editor, uploads and the place picture. The rating bar of All places is the rating row the lists show, with its voters, and votes once for every copy. All places filters by a lowest rating and sorts by it, and the edit form changes the first copy the reader may edit, which the server carries to the others.
This commit is contained in:
@@ -26,7 +26,7 @@ interface CopyToTripModalProps {
|
||||
*/
|
||||
export default function CopyToTripModal({ isOpen, onClose, placeIds, onCopy, carryOptions, t }: CopyToTripModalProps): React.ReactElement | null {
|
||||
const labelId = useId()
|
||||
const { loading, search, setSearch, filtered, busyTripId, dateRange, handleCopy, offersCarry, includeNotes, setIncludeNotes, tagIds, toggleTag, personalTagIds, togglePersonalTag } =
|
||||
const { loading, search, setSearch, filtered, busyTripId, dateRange, handleCopy, offersCarry, includeNotes, setIncludeNotes, tagIds, toggleTag } =
|
||||
useTripCopyPicker({ open: isOpen, onCopy, onClose, t, emptySelection: placeIds.length === 0, carryOptions })
|
||||
|
||||
if (!isOpen) return null
|
||||
@@ -36,8 +36,6 @@ export default function CopyToTripModal({ isOpen, onClose, placeIds, onCopy, car
|
||||
onClose={onClose}
|
||||
labelledBy={labelId}
|
||||
width="narrow"
|
||||
// The list shrinks while the search narrows it; a pinned top edge keeps the field still.
|
||||
align="top"
|
||||
header={(
|
||||
<DialogHeader
|
||||
tile={<DialogTile><Copy size={20} strokeWidth={1.9} className="text-content-muted" /></DialogTile>}
|
||||
@@ -66,8 +64,11 @@ export default function CopyToTripModal({ isOpen, onClose, placeIds, onCopy, car
|
||||
/>
|
||||
</div>
|
||||
{offersCarry && carryOptions && (
|
||||
<CopyCarryPanel options={carryOptions} includeNotes={includeNotes} onIncludeNotes={setIncludeNotes} tagIds={tagIds} onToggleTag={toggleTag} personalTagIds={personalTagIds} onTogglePersonalTag={togglePersonalTag} variant="dialog" t={t} />
|
||||
<CopyCarryPanel options={carryOptions} includeNotes={includeNotes} onIncludeNotes={setIncludeNotes} tagIds={tagIds} onToggleTag={toggleTag} variant="dialog" t={t} />
|
||||
)}
|
||||
{/* One fixed height for the trips, whatever the search leaves: the centred dialog
|
||||
then keeps its size and the search field stays where it is while typing. */}
|
||||
<div className="h-[min(360px,45vh)] overflow-y-auto">
|
||||
{loading ? (
|
||||
<div className="flex items-center justify-center py-8 text-content-faint">
|
||||
<Loader2 size={20} className="animate-spin" />
|
||||
@@ -104,6 +105,7 @@ export default function CopyToTripModal({ isOpen, onClose, placeIds, onCopy, car
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DialogShell>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user