diff --git a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx index 72cd37f5d..ec5db379c 100644 --- a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx +++ b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx @@ -103,7 +103,7 @@ function SwitchSplitOrientationButton({ note, isReadOnly, isDefaultViewMode }: F function ToggleReadOnlyButton({ note, viewType, isDefaultViewMode }: FloatingButtonContext) { const [ isReadOnly, setReadOnly ] = useNoteLabelBoolean(note, "readOnly"); - const isEnabled = ([ "mermaid", "mindMap", "canvas" ].includes(note.type) || viewType === "geoMap") + const isEnabled = !isNewLayout && ([ "mermaid", "mindMap", "canvas" ].includes(note.type) || viewType === "geoMap") && note.isContentAvailable() && isDefaultViewMode; return isEnabled && ; } -function AddChildButton({ parentComponent, noteType, ntxId }: NoteActionsCustomInnerProps) { - const isEnabled = noteType === "relationMap"; - return isEnabled && parentComponent.triggerEvent("relationMapCreateChildNote", { ntxId })} - />; +function AddChildButton({ parentComponent, noteType, viewType, ntxId, isReadOnly }: NoteActionsCustomInnerProps) { + if (noteType === "book" && viewType === "geoMap") { + return parentComponent.triggerEvent("geoMapCreateChildNote", { ntxId })} + disabled={isReadOnly} + />; + } else if (noteType === "relationMap") { + return parentComponent.triggerEvent("relationMapCreateChildNote", { ntxId })} + disabled={isReadOnly} + />; + } } //#endregion