fix: prioritize map object settings
This commit is contained in:
parent
9d538f97bf
commit
66e5c41563
@ -55,6 +55,22 @@ export default function LocationMapBottomSheet({
|
||||
: selectedObject
|
||||
? selectedTitle
|
||||
: "Map Details";
|
||||
const showEditorControls = mode === "edit" && canManage;
|
||||
const showSelectedObjectForm = Boolean(mode === "edit" && editorTool === "edit" && selectedObject);
|
||||
const editorActions = showEditorControls ? (
|
||||
<div className="location-map-editor-actions location-map-primary-actions">
|
||||
<button type="button" onClick={onAddObject}>Add Area</button>
|
||||
<button type="button" onClick={onPreviewDraft}>Preview Draft</button>
|
||||
<button type="button" className="primary" onClick={onSaveDraft} disabled={saving || !hasUnsavedChanges}>Save Draft</button>
|
||||
<button type="button" className="primary" onClick={onPublish} disabled={saving || !mapState?.draft_map}>Publish</button>
|
||||
<button type="button" onClick={onUndo} disabled={history.length === 0}>Undo</button>
|
||||
<button type="button" onClick={onRedo} disabled={future.length === 0}>Redo</button>
|
||||
</div>
|
||||
) : canManage && mapState?.published_map ? (
|
||||
<div className="location-map-editor-actions">
|
||||
<button type="button" onClick={onEditMode}>Edit Map</button>
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
return (
|
||||
<aside className="location-map-bottom-sheet">
|
||||
@ -92,22 +108,9 @@ export default function LocationMapBottomSheet({
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{mode === "edit" && canManage ? (
|
||||
<div className="location-map-editor-actions location-map-primary-actions">
|
||||
<button type="button" onClick={onAddObject}>Add Area</button>
|
||||
<button type="button" onClick={onPreviewDraft}>Preview Draft</button>
|
||||
<button type="button" className="primary" onClick={onSaveDraft} disabled={saving || !hasUnsavedChanges}>Save Draft</button>
|
||||
<button type="button" className="primary" onClick={onPublish} disabled={saving || !mapState?.draft_map}>Publish</button>
|
||||
<button type="button" onClick={onUndo} disabled={history.length === 0}>Undo</button>
|
||||
<button type="button" onClick={onRedo} disabled={future.length === 0}>Redo</button>
|
||||
</div>
|
||||
) : canManage && mapState?.published_map ? (
|
||||
<div className="location-map-editor-actions">
|
||||
<button type="button" onClick={onEditMode}>Edit Map</button>
|
||||
</div>
|
||||
) : null}
|
||||
{showSelectedObjectForm ? null : editorActions}
|
||||
|
||||
{mode === "edit" && canManage ? (
|
||||
{showEditorControls ? (
|
||||
<div className="location-map-mobile-tool-switch" aria-label="Edit tool">
|
||||
<button
|
||||
type="button"
|
||||
@ -232,6 +235,8 @@ export default function LocationMapBottomSheet({
|
||||
</p>
|
||||
)}
|
||||
|
||||
{showSelectedObjectForm ? editorActions : null}
|
||||
|
||||
{filters.showUnmapped && visibleUnmappedItems.length > 0 ? (
|
||||
<div className="location-map-unmapped-list">
|
||||
<strong>Unmapped Items</strong>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user