add hypermd

This commit is contained in:
Fedor Katurov 2024-10-08 17:30:33 +07:00
parent 3a4e8e7702
commit dfaa6342a3
8 changed files with 2007 additions and 26 deletions

View file

@ -5,6 +5,7 @@ import { MarkdownViewer } from "../../components/MarkdownViewer";
import { SimpleTextareaEditor } from "../../components/SimpleTextareaEditor";
import styles from "./styles.module.scss";
import { useStorage } from "../../../../modules/storage/StorageContext";
import { HyperEditor } from "../../components/HyperEditor";
interface MarkdownEditorContainerProps {
id: string;
@ -13,6 +14,8 @@ interface MarkdownEditorContainerProps {
remove: VoidCallback;
}
const enableCoolEditor = true;
export const MarkdownEditorContainer: FC<MarkdownEditorContainerProps> = ({
id,
locked,
@ -37,11 +40,15 @@ export const MarkdownEditorContainer: FC<MarkdownEditorContainerProps> = ({
const editor = (
<EditorWrapper save={startEditing} remove={remove}>
<SimpleTextareaEditor
value={value}
onChange={onChange}
save={startEditing}
/>
{enableCoolEditor ? (
<HyperEditor value={value} onChange={onChange} />
) : (
<SimpleTextareaEditor
value={value}
onChange={onChange}
save={startEditing}
/>
)}
</EditorWrapper>
);