Hide WYSIWYG buttons when previewing markdown (#2366)

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
This commit is contained in:
SleeplessOne1917 2024-02-16 22:57:07 +00:00 committed by GitHub
parent 77cd46b35b
commit 40ade7df88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -156,6 +156,7 @@ export class MarkdownTextArea extends Component<
<div className="mb-3 row">
<div className="col-12">
<div className="rounded bg-light border">
{!this.state.previewMode && (
<div
className={classNames("d-flex flex-wrap border-bottom", {
"no-click": this.isDisabled,
@ -206,7 +207,10 @@ export class MarkdownTextArea extends Component<
{this.getFormatButton("quote", this.handleInsertQuote)}
{this.getFormatButton("list", this.handleInsertList)}
{this.getFormatButton("code", this.handleInsertCode)}
{this.getFormatButton("subscript", this.handleInsertSubscript)}
{this.getFormatButton(
"subscript",
this.handleInsertSubscript,
)}
{this.getFormatButton(
"superscript",
this.handleInsertSuperscript,
@ -221,7 +225,7 @@ export class MarkdownTextArea extends Component<
<Icon icon="help-circle" classes="icon-inline" />
</a>
</div>
)}
<div>
<textarea
id={this.id}