diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx index b01691ffc..327bae859 100644 --- a/apps/web/src/components/editor/index.tsx +++ b/apps/web/src/components/editor/index.tsx @@ -59,14 +59,8 @@ import { ScopedThemeProvider } from "../theme-provider"; import { Lightbox } from "../lightbox"; import { Allotment } from "allotment"; import { showToast } from "../../utils/toast"; -import { - ContentType, - Item, - MaybeDeletedItem, - isDeleted -} from "@notesnook/core/dist/types"; +import { Item, MaybeDeletedItem, isDeleted } from "@notesnook/core/dist/types"; import { debounce, debounceWithId } from "@notesnook/common"; -import { PreviewSession } from "./types"; import { Freeze } from "react-freeze"; import { EditorActionBar } from "./action-bar"; import { UnlockView } from "../unlock"; @@ -150,7 +144,6 @@ function EditorView({ const lastChangedTime = useRef(Date.now()); const [docPreview, setDocPreview] = useState(); - const previewSession = useRef(); const [dropRef, overlayRef] = useDragOverlay(); const root = useRef(null); @@ -159,9 +152,6 @@ function EditorView({ ); const isTOCVisible = useEditorStore((store) => store.isTOCVisible); const toggleProperties = useEditorStore((store) => store.toggleProperties); - const isReadonly = useEditorStore( - (store) => store.getSession(id, ["default", "readonly"])?.note?.readonly - ); const isFocusMode = useAppStore((store) => store.isFocusMode); const editor = useEditorManager((store) => store.editors[session.id]?.editor); @@ -248,14 +238,6 @@ function EditorView({ background: "background" }} > - {/* {previewSession.current && ( - - typeof noteId === "string" && openSession(noteId) - } - /> - )} */} void; -// }; -// function PreviewModeNotice(props: PreviewModeNoticeProps) { -// const { dateCreated, dateEdited, content, onDiscard } = props; -// const disablePreviewMode = useCallback( -// async (cancelled: boolean) => { -// const { id, sessionId } = useEditorStore.getState().session; -// if (!cancelled) { -// await editorstore.saveSessionContent(id, sessionId, content); -// } -// onDiscard(); -// }, -// [onDiscard, content] -// ); - -// return ( -// -// -// Preview -// -// You are previewing note version edited from{" "} -// {getFormattedDate(dateCreated, "date-time")} to{" "} -// {getFormattedDate(dateEdited, "date-time")}. -// -// -// -// -// -// -// -// ); -// } - type DropZoneProps = { overlayRef: React.MutableRefObject; editor: IEditor;