Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(layout): remove lock/unlock buttons in new layout
Elian Doran9b94d232a8a2
diff --git a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx b/apps/client/src/widgets/FloatingButtonsDefinitions.tsxindex 2e82c4a0b0..83cf453051 100644--- a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx+++ b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx@@ -100,7 +100,7 @@ function SwitchSplitOrientationButton({ note, isReadOnly, isDefaultViewMode }: Ffunction ToggleReadOnlyButton({ note, isDefaultViewMode }: FloatingButtonContext) {const [ isReadOnly, setReadOnly ] = useNoteLabelBoolean(note, "readOnly");const isSavedSqlite = note.isTriliumSqlite() && !note.isHiddenCompletely();- const isEnabled = ([ "mindMap", "canvas" ].includes(note.type) || isSavedSqlite)+ const isEnabled = ([ "mindMap", "canvas", "spreadsheet" ].includes(note.type) || isSavedSqlite)&& note.isContentAvailable() && isDefaultViewMode;return isEnabled && <FloatingButtondiff --git a/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx b/apps/client/src/widgets/ribbon/NoteActionsCustom.tsxindex 899c6f46fa..94c08a1550 100644--- a/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx+++ b/apps/client/src/widgets/ribbon/NoteActionsCustom.tsx@@ -72,7 +72,6 @@ export default function NoteActionsCustom(props: NoteActionsCustomProps) {><AddChildButton {...innerProps} /><RunActiveNoteButton {...innerProps } />- <ToggleReadOnlyButton {...innerProps} /><DisplayModeSwitcher {...innerProps} /><SwitchSplitOrientationButton {...innerProps} /><SaveToNoteButton {...innerProps} />@@ -206,19 +205,6 @@ function SwitchSplitOrientationButton({ note, isReadOnly, isDefaultViewMode }: N/>;}-export function ToggleReadOnlyButton({ note, isDefaultViewMode }: NoteActionsCustomInnerProps) {- const [ isReadOnly, setReadOnly ] = useNoteLabelBoolean(note, "readOnly");- const isSavedSqlite = note.isTriliumSqlite() && !note.isHiddenCompletely();- const isEnabled = ([ "mindMap", "canvas", "spreadsheet" ].includes(note.type) || isSavedSqlite)- && note.isContentAvailable() && isDefaultViewMode;-- return isEnabled && <NoteAction- text={isReadOnly ? t("toggle_read_only_button.unlock-editing") : t("toggle_read_only_button.lock-editing")}- icon={isReadOnly ? "bx bx-lock-open-alt" : "bx bx-lock-alt"}- onClick={() => setReadOnly(!isReadOnly)}- />;-}-function DisplayModeSwitcher({ note, isDefaultViewMode }: NoteActionsCustomInnerProps) {const [ displayMode, setDisplayMode ] = useNoteLabel(note, "displayMode");const isEnabled = (note.isMarkdown() || note.type === "mermaid") && note.isContentAvailable() && isDefaultViewMode;