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 9fc3f9d3b1..c096e1d64e 100644 --- a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx +++ b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx @@ -1,12 +1,22 @@ +import { t } from "../../services/i18n"; +import { FormDropdownDivider } from "../react/FormList"; import { useNoteContext } from "../react/hooks"; -import { NoteContextMenu } from "../ribbon/NoteActions"; +import { CommandItem, NoteContextMenu } from "../ribbon/NoteActions"; export default function MobileDetailMenu() { const { note, noteContext } = useNoteContext(); return (
- {note && } + {note && ( + + + + } + /> + )}
); } diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsx index 6aa05234db..39c3ebe354 100644 --- a/apps/client/src/widgets/ribbon/NoteActions.tsx +++ b/apps/client/src/widgets/ribbon/NoteActions.tsx @@ -1,6 +1,6 @@ import { ConvertToAttachmentResponse } from "@triliumnext/commons"; import { Dropdown as BootstrapDropdown } from "bootstrap"; -import { RefObject } from "preact"; +import { ComponentChildren, RefObject } from "preact"; import { useContext, useEffect, useRef } from "preact/hooks"; import appContext, { CommandNames } from "../../components/app_context"; @@ -14,7 +14,7 @@ import { t } from "../../services/i18n"; import protected_session from "../../services/protected_session"; import server from "../../services/server"; import toast from "../../services/toast"; -import { isElectron as getIsElectron, isMac as getIsMac } from "../../services/utils"; +import { isElectron as getIsElectron, isMac as getIsMac, isMobile } from "../../services/utils"; import ws from "../../services/ws"; import ClosePaneButton from "../buttons/close_pane_button"; import CreatePaneButton from "../buttons/create_pane_button"; @@ -63,7 +63,7 @@ function RevisionsButton({ note }: { note: FNote }) { type ItemToFocus = "basic-properties"; -export function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: NoteContext }) { +export function NoteContextMenu({ note, noteContext, extraItems }: { note: FNote, noteContext?: NoteContext, extraItems?: ComponentChildren; }) { const dropdownRef = useRef(null); const parentComponent = useContext(ParentComponent); const noteType = useNoteProperty(note, "type") ?? ""; @@ -107,6 +107,7 @@ export function NoteContextMenu({ note, noteContext }: { note: FNote, noteContex onHidden={() => itemToFocusRef.current = null } mobileBackdrop > + {extraItems} {isReadOnly && <> void), disabled?: boolean, destructive?: boolean }) { +export function CommandItem({ icon, text, title, command, disabled }: { icon: string, text: string, title?: string, command: CommandNames | (() => void), disabled?: boolean, destructive?: boolean }) { return