Skip to content

Commit

Permalink
chore: retire preview markdown dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Aug 7, 2024
1 parent 4ad6028 commit 61b8cee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 75 deletions.
16 changes: 0 additions & 16 deletions web/src/components/MemoEditor/ActionButton/MarkdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Dropdown, IconButton, Menu, MenuButton, MenuItem } from "@mui/joy";
import { Link } from "@mui/joy";
import toast from "react-hot-toast";
import Icon from "@/components/Icon";
import showPreviewMarkdownDialog from "@/components/PreviewMarkdownDialog";
import { EditorRefActions } from "../Editor";

interface Props {
Expand Down Expand Up @@ -59,16 +57,6 @@ const MarkdownMenu = (props: Props) => {
});
};

const handlePreviewClick = () => {
const content = editorRef.current?.getContent() ?? "";
if (content === "") {
toast.error("Nothing to preview");
return;
}

showPreviewMarkdownDialog(editorRef.current?.getContent() ?? "");
};

return (
<Dropdown>
<MenuButton
Expand All @@ -90,10 +78,6 @@ const MarkdownMenu = (props: Props) => {
<Icon.CheckSquare className="w-4 h-auto" />
<span>Checkbox</span>
</MenuItem>
<MenuItem onClick={handlePreviewClick}>
<Icon.GanttChartSquare className="w-4 h-auto" />
<span>Preview</span>
</MenuItem>
<div className="-mt-0.5 pl-2">
<Link fontSize={12} href="https://www.usememos.com/docs/getting-started/content-syntax" target="_blank">
Content syntax
Expand Down
59 changes: 0 additions & 59 deletions web/src/components/PreviewMarkdownDialog.tsx

This file was deleted.

0 comments on commit 61b8cee

Please sign in to comment.