diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx index c9d97a62..8e6537a6 100644 --- a/src/components/editor/Editor.tsx +++ b/src/components/editor/Editor.tsx @@ -39,7 +39,7 @@ export const Editor = () => { }); }; - const { editorRef, editorView } = useCM6Editor({ + const { editorRef } = useCM6Editor({ initialDoc: currentNote?.content ?? currentTrashedNote?.content ?? "", onChange, }); diff --git a/src/components/notes/SearchFeed.tsx b/src/components/notes/SearchFeed.tsx index 8f1e1ddd..b00545e2 100644 --- a/src/components/notes/SearchFeed.tsx +++ b/src/components/notes/SearchFeed.tsx @@ -4,8 +4,6 @@ import { useAppContext } from "~/store"; import { useInView } from "react-intersection-observer"; import NoteCard from "./NoteCard"; -import NoteFeedHeader from "./NoteFeedHeader"; -import SearchNotes from "./SearchNotes"; type Props = { noteSearch: string; diff --git a/src/lib/scrollpastend.ts b/src/lib/scrollpastend.ts deleted file mode 100644 index 7359d166..00000000 --- a/src/lib/scrollpastend.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {Extension} from "@codemirror/state" -import { ViewPlugin, ViewUpdate } from "@codemirror/view" -// import {ViewPlugin, ViewUpdate, contentAttributes} from "./extension" - -const plugin = ViewPlugin.fromClass(class { - height = 1000 - attrs = {style: "padding-bottom: 1000px"} - - update(update: ViewUpdate) { - const {view} = update - let height = view.viewState.editorHeight - - view.defaultLineHeight - view.documentPadding.top - 0.5 - if (height >= 0 && height != this.height) { - this.height = height - this.attrs = {style: `padding-bottom: ${height}px`} - } - } -}) - -/// Returns an extension that makes sure the content has a bottom -/// margin equivalent to the height of the editor, minus one line -/// height, so that every line in the document can be scrolled to the -/// top of the editor. -/// -/// This is only meaningful when the editor is scrollable, and should -/// not be enabled in editors that take the size of their content. -export function scrollPastEnd(): Extension { - return [plugin, contentAttributes.of(view => view.plugin(plugin)?.attrs || null)] -} diff --git a/src/main.tsx b/src/main.tsx index 3ea7c024..0eb63d29 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,4 @@ -import React from "react"; - import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import ReactDOM from "react-dom/client"; import { BrowserRouter } from "react-router-dom";