Enable HTML mode toggle (#4442)
This commit is contained in:
@ -54,6 +54,7 @@ export function ArticleNotes(props: NoteSectionProps): JSX.Element {
|
|||||||
setText={props.setText}
|
setText={props.setText}
|
||||||
saveText={saveText}
|
saveText={saveText}
|
||||||
fillBackground={false}
|
fillBackground={false}
|
||||||
|
isExpanded
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -104,6 +105,7 @@ export function HighlightViewNote(props: HighlightViewNoteProps): JSX.Element {
|
|||||||
setText={props.setText}
|
setText={props.setText}
|
||||||
saveText={saveText}
|
saveText={saveText}
|
||||||
fillBackground={true}
|
fillBackground={true}
|
||||||
|
isExpanded={false}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -116,6 +118,7 @@ type MarkdownNote = {
|
|||||||
text: string | undefined
|
text: string | undefined
|
||||||
setText: (text: string) => void
|
setText: (text: string) => void
|
||||||
fillBackground: boolean | undefined
|
fillBackground: boolean | undefined
|
||||||
|
isExpanded: boolean
|
||||||
|
|
||||||
saveText: (text: string) => void
|
saveText: (text: string) => void
|
||||||
}
|
}
|
||||||
@ -204,11 +207,12 @@ export function MarkdownNote(props: MarkdownNote): JSX.Element {
|
|||||||
'block-quote',
|
'block-quote',
|
||||||
'link',
|
'link',
|
||||||
'auto-resize',
|
'auto-resize',
|
||||||
|
'mode-toggle',
|
||||||
'save',
|
'save',
|
||||||
]}
|
]}
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '180px',
|
height: props.isExpanded ? '360px' : '180px',
|
||||||
}}
|
}}
|
||||||
renderHTML={(text: string) => mdParser.render(text)}
|
renderHTML={(text: string) => mdParser.render(text)}
|
||||||
onChange={handleEditorChange}
|
onChange={handleEditorChange}
|
||||||
|
|||||||
@ -17,7 +17,14 @@ export default class MDEditorSavePlugin extends PluginComponent {
|
|||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
style="plainIcon"
|
style="plainIcon"
|
||||||
css={{ display: 'flex', pr: '5px' }}
|
css={{
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
height: '28px',
|
||||||
|
justifyContent: 'center',
|
||||||
|
lineHeight: '28px',
|
||||||
|
minWidth: '24px',
|
||||||
|
}}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
document.dispatchEvent(new Event('saveMarkdownNote'))
|
document.dispatchEvent(new Event('saveMarkdownNote'))
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|||||||
Reference in New Issue
Block a user