diff --git a/src/components/Editor/components/ArticlesList.tsx b/src/components/Editor/components/ArticlesList.tsx deleted file mode 100644 index 8bdd6e18..00000000 --- a/src/components/Editor/components/ArticlesList.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import '../styles/ArticlesList.scss' - -export default () => { - return ( -
-
-
-
Черновик
-
- Поствыживание. Комплекс вины и кризис самооценки в дивном новом мире.{' '} - В летописи российского музыкального подполья остаётся множество лакун. -
- -
-
-
Редактировать
-
Опубликовать
-
Удалить
-
-
-
- ) -} diff --git a/src/components/Editor/components/Editor.tsx b/src/components/Editor/components/Editor.tsx new file mode 100644 index 00000000..c87915d3 --- /dev/null +++ b/src/components/Editor/components/Editor.tsx @@ -0,0 +1,33 @@ +import type { EditorView } from 'prosemirror-view' +import type { EditorState } from 'prosemirror-state' +import { useState } from '../store' +import { ProseMirror } from '../components/ProseMirror' +import '../styles/Editor.scss' +import type { ProseMirrorExtension, ProseMirrorState } from '../prosemirror/helpers' + +export default () => { + const [store, ctrl] = useState() + const onInit = (text: EditorState, editorView: EditorView) => ctrl.setState({ editorView, text }) + const onReconfigure = (text: EditorState) => ctrl.setState({ text }) + const onChange = (text: EditorState) => ctrl.setState({ text, lastModified: new Date() }) + // const editorCss = (config) => css`` + const style = () => { + if (store.error) { + return `display: none;` + } else { + return store.markdown ? `white-space: pre-wrap;` : '' + } + } + return ( + + ) +} diff --git a/src/components/Editor/components/Error.tsx b/src/components/Editor/components/Error.tsx index dc04cb26..bcfcb97b 100644 --- a/src/components/Editor/components/Error.tsx +++ b/src/components/Editor/components/Error.tsx @@ -1,5 +1,23 @@ -import { Switch, Match, createMemo } from 'solid-js' -import { ErrorObject, useState } from '../store/context' +import { Switch, Match } from 'solid-js' +import { useState } from '../store' +import '../styles/Button.scss' + +export default () => { + const [store] = useState() + return ( + }> + + + + + + + + + + + ) +} const InvalidState = (props: { title: string }) => { const [store, ctrl] = useState() @@ -15,7 +33,7 @@ const InvalidState = (props: { title: string }) => { you can copy important notes from below, clean the state and paste it again.

-          {JSON.stringify(store.error)}
+          {JSON.stringify(store.error.props)}