chore(popup-editor): implement switch to full editor button

This commit is contained in:
Elian Doran 2025-11-30 19:47:17 +02:00
parent 030582b2d5
commit aacd92eee3
No known key found for this signature in database
2 changed files with 12 additions and 2 deletions

View File

@ -2107,5 +2107,8 @@
"clear-color": "Clear note color", "clear-color": "Clear note color",
"set-color": "Set note color", "set-color": "Set note color",
"set-custom-color": "Set custom note color" "set-custom-color": "Set custom note color"
},
"popup-editor": {
"maximize": "Switch to full editor"
} }
} }

View File

@ -19,6 +19,8 @@ import tree from "../../services/tree";
import froca from "../../services/froca"; import froca from "../../services/froca";
import ReadOnlyNoteInfoBar from "../ReadOnlyNoteInfoBar"; import ReadOnlyNoteInfoBar from "../ReadOnlyNoteInfoBar";
import MobileEditorToolbar from "../type_widgets/text/mobile_editor_toolbar"; import MobileEditorToolbar from "../type_widgets/text/mobile_editor_toolbar";
import { t } from "../../services/i18n";
import appContext from "../../components/app_context";
export default function PopupEditor() { export default function PopupEditor() {
const [ shown, setShown ] = useState(false); const [ shown, setShown ] = useState(false);
@ -62,8 +64,13 @@ export default function PopupEditor() {
title={<TitleRow />} title={<TitleRow />}
customTitleBarButtons={[{ customTitleBarButtons={[{
iconClassName: "bx-expand-alt", iconClassName: "bx-expand-alt",
title: "Switch to full editor", title: t("popup-editor.maximize"),
onClick: () => {/* TO DO */} onClick: async () => {
if (!noteContext.noteId) return;
const { noteId, hoistedNoteId } = noteContext;
await appContext.tabManager.openInNewTab(noteId, hoistedNoteId, true);
setShown(false);
}
}]} }]}
className="popup-editor-dialog" className="popup-editor-dialog"
size="lg" size="lg"