From f8a3a067f0ef2a0fbf86969e20be727fd5c60791 Mon Sep 17 00:00:00 2001 From: rbarbazz <42906704+rbarbazz@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:35:15 -0700 Subject: [PATCH] Enable HTML mode toggle --- packages/web/components/patterns/ArticleNotes.tsx | 6 +++++- packages/web/components/patterns/MDEditorSavePlugin.tsx | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/web/components/patterns/ArticleNotes.tsx b/packages/web/components/patterns/ArticleNotes.tsx index d0e10559c0..1c77d1b8b0 100644 --- a/packages/web/components/patterns/ArticleNotes.tsx +++ b/packages/web/components/patterns/ArticleNotes.tsx @@ -54,6 +54,7 @@ export function ArticleNotes(props: NoteSectionProps): JSX.Element { setText={props.setText} saveText={saveText} fillBackground={false} + isExpanded /> ) } @@ -104,6 +105,7 @@ export function HighlightViewNote(props: HighlightViewNoteProps): JSX.Element { setText={props.setText} saveText={saveText} fillBackground={true} + isExpanded={false} /> ) } @@ -116,6 +118,7 @@ type MarkdownNote = { text: string | undefined setText: (text: string) => void fillBackground: boolean | undefined + isExpanded: boolean saveText: (text: string) => void } @@ -204,11 +207,12 @@ export function MarkdownNote(props: MarkdownNote): JSX.Element { 'block-quote', 'link', 'auto-resize', + 'mode-toggle', 'save', ]} style={{ width: '100%', - height: '180px', + height: props.isExpanded ? '360px' : '180px', }} renderHTML={(text: string) => mdParser.render(text)} onChange={handleEditorChange} diff --git a/packages/web/components/patterns/MDEditorSavePlugin.tsx b/packages/web/components/patterns/MDEditorSavePlugin.tsx index 86ce136fe2..38c0927203 100644 --- a/packages/web/components/patterns/MDEditorSavePlugin.tsx +++ b/packages/web/components/patterns/MDEditorSavePlugin.tsx @@ -17,7 +17,14 @@ export default class MDEditorSavePlugin extends PluginComponent { return (