Extract mobile editor navigation helper
This commit is contained in:
1 parent
7f2f41c54c
commit
158ef57f8e
3 files changed
+9
-16
No files matched your search
@@ -50,6 +50,7 @@ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "@
|
||||
import { EditorToolbar } from "./EditorToolbar";
|
||||
import { RevisionHistoryDialog } from "./dialogs/RevisionHistoryDialog";
|
||||
import { api } from "@/lib/api";
|
||||
import { openStandaloneMobileEditor } from "@/lib/mobile-editor";
|
||||
import { cn, formatDateTime, parseTagsText } from "@/lib/utils";
|
||||
import { docToMarkdown, markdownToDoc, type Notebook, type MemoDetail, type TiptapDoc } from "@edgeever/shared";
|
||||
import { compressImageForUpload } from "@/lib/image-compression";
|
||||
@@ -467,14 +468,6 @@ type RichEditorPaneProps = EditorPaneProps & {
|
||||
onRequestMobileNativeEdit?: () => void;
|
||||
};
|
||||
|
||||
const openStandaloneMobileEditor = (memoId: string) => {
|
||||
const params = new URLSearchParams({
|
||||
memoId,
|
||||
returnTo: "/",
|
||||
});
|
||||
window.location.href = `/mobile-edit.html#${params.toString()}`;
|
||||
};
|
||||
|
||||
const MobileNativeEditorPane = ({
|
||||
memo,
|
||||
notebooks,
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
import { MemoListPane, MemoSelectionActionBar } from "./MemoListPane";
|
||||
import { AppConfirmDialog, MemoDeleteConfirmDialog, NotebookNameDialog } from "./dialogs/ConfirmDialogs";
|
||||
import { api } from "@/lib/api";
|
||||
import { openStandaloneMobileEditor } from "@/lib/mobile-editor";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { createExcerpt, docToText, type Notebook, type AuthUser, type MemoSummary, type MemoDetail } from "@edgeever/shared";
|
||||
import type {
|
||||
@@ -79,14 +80,6 @@ const isStandaloneApp = () =>
|
||||
window.matchMedia("(display-mode: fullscreen)").matches ||
|
||||
Boolean((navigator as Navigator & { standalone?: boolean }).standalone);
|
||||
|
||||
const openStandaloneMobileEditor = (memoId: string) => {
|
||||
const params = new URLSearchParams({
|
||||
memoId,
|
||||
returnTo: "/",
|
||||
});
|
||||
window.location.href = `/mobile-edit.html#${params.toString()}`;
|
||||
};
|
||||
|
||||
const getVerticalScrollContainer = (target: EventTarget | null) => {
|
||||
let element = target instanceof HTMLElement ? target : null;
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
export const openStandaloneMobileEditor = (memoId: string) => {
|
||||
const params = new URLSearchParams({
|
||||
memoId,
|
||||
returnTo: "/",
|
||||
});
|
||||
window.location.href = `/mobile-edit.html#${params.toString()}`;
|
||||
};
|
||||
Reference in new issue
Block a user