Add survey page

This commit is contained in:
1ilit
2023-10-12 23:17:23 +03:00
parent eaf4812dbe
commit e2a37b68e4
5 changed files with 323 additions and 12 deletions

View File

@@ -978,8 +978,8 @@ export default function ControlPanel(props) {
"Report a bug": {
function: () => window.open("/bug_report", "_blank"),
},
"Suggest a feature": {
function: () => {},
"Give feedback": {
function: () => window.open("/survey", "_blank"),
},
},
};

View File

@@ -6,7 +6,7 @@ import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
import { ClearEditorPlugin } from '@lexical/react/LexicalClearEditorPlugin';
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
import { TRANSFORMERS } from "@lexical/markdown";
import ToolbarPlugin from "../plugins/ToolbarPlugin";
@@ -15,18 +15,18 @@ import CodeHighlightPlugin from "../plugins/CodeHighlightPlugin";
import AutoLinkPlugin from "../plugins/AutoLinkPlugin";
import "../styles/richeditor.css";
function Placeholder() {
return <div className="editor-placeholder">Describe the bug</div>;
function Placeholder({ text }) {
return <div className="editor-placeholder">{text || ""}</div>;
}
export default function RichEditor({ theme }) {
export default function RichEditor({ theme, placeholder }) {
return (
<div className="editor-container">
<ToolbarPlugin theme={theme} />
<div className="editor-inner">
<RichTextPlugin
contentEditable={<ContentEditable className="editor-input" />}
placeholder={<Placeholder />}
placeholder={<Placeholder text={placeholder} />}
ErrorBoundary={LexicalErrorBoundary}
/>
<HistoryPlugin />
@@ -37,7 +37,7 @@ export default function RichEditor({ theme }) {
<AutoLinkPlugin />
<ListMaxIndentLevelPlugin maxDepth={7} />
<MarkdownShortcutPlugin transformers={TRANSFORMERS} />
<ClearEditorPlugin/>
<ClearEditorPlugin />
</div>
</div>
);