Skip to content

Build your personal knowledge base with Trilium Notes

chore(mobile): relocate some note actions

Elian Doranc709b5d34c3e
diff --git a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx
index f35137b77a..2aa527feaa 100644
--- a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx
+++ b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx
@@ -46,7 +46,7 @@ export default function MobileDetailMenu() {
<NoteContextMenu
dropdownRef={dropdownRef}
note={note} noteContext={noteContext}
- extraItems={<>
+ itemsAtStart={<>
<div className="form-list-row">
<div className="form-list-col">
<FormListItem
@@ -90,6 +90,8 @@ export default function MobileDetailMenu() {
>{t("close_pane_button.close_this_pane")}</FormListItem>
</>}
<FormDropdownDivider />
+ </>}
+ itemsNearNoteSettings={<>
{note.type === "text" && <ContentLanguageSelector note={note} />}
{note.type === "code" && <FormListItem icon={"bx bx-code"} onClick={() => setCodeNoteSwitcherModalShown(true)}>{t("status_bar.code_note_switcher")}</FormListItem>}
<FormListItem icon="bx bx-info-circle" onClick={() => setNoteInfoModalShown(true)}>{t("note_info_widget.title")}</FormListItem>
diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsx
index daeab278cc..b818672709 100644
--- a/apps/client/src/widgets/ribbon/NoteActions.tsx
+++ b/apps/client/src/widgets/ribbon/NoteActions.tsx
@@ -63,10 +63,11 @@ function RevisionsButton({ note }: { note: FNote }) {
type ItemToFocus = "basic-properties";
-export function NoteContextMenu({ note, noteContext, extraItems, dropdownRef: externalDropdownRef }: {
+export function NoteContextMenu({ note, noteContext, itemsAtStart, itemsNearNoteSettings, dropdownRef: externalDropdownRef }: {
note: FNote,
noteContext?: NoteContext,
- extraItems?: ComponentChildren;
+ itemsAtStart?: ComponentChildren;
+ itemsNearNoteSettings?: ComponentChildren;
dropdownRef?: RefObject<BootstrapDropdown>;
}) {
const dropdownRef = useSyncedRef<BootstrapDropdown>(externalDropdownRef, null);
@@ -112,7 +113,7 @@ export function NoteContextMenu({ note, noteContext, extraItems, dropdownRef: ex
onHidden={() => itemToFocusRef.current = null }
mobileBackdrop
>
- {extraItems}
+ {itemsAtStart}
{isReadOnly && <>
<CommandItem icon="bx bx-pencil" text={t("read-only-info.edit-note")}
@@ -131,6 +132,8 @@ export function NoteContextMenu({ note, noteContext, extraItems, dropdownRef: ex
<FormDropdownDivider />
</>}
+ {itemsNearNoteSettings}
+
<CommandItem icon="bx bx-import" text={t("note_actions.import_files")}
disabled={isInOptionsOrHelp || note.type === "search"}
command={() => parentComponent?.triggerCommand("showImportDialog", { noteId: note.noteId })} />