Update App.tsx to handle markdown preview and split view states
This commit is contained in:
12
src/App.tsx
12
src/App.tsx
@@ -1539,13 +1539,13 @@ export default function App() {
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
className={`editor__textarea-wrap${
|
className={`editor__textarea-wrap${
|
||||||
markdownPreview ? " editor__textarea-wrap--preview" : ""
|
markdownPreview && !splitView ? " editor__textarea-wrap--preview" : ""
|
||||||
}`}
|
}${markdownPreview && splitView ? " editor__textarea-wrap--split" : ""}`}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
ref={editorHostRef}
|
ref={editorHostRef}
|
||||||
className={`editor__codemirror${
|
className={`editor__codemirror${
|
||||||
markdownPreview ? " editor__codemirror--hidden" : ""
|
markdownPreview && !splitView ? " editor__codemirror--hidden" : ""
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
@@ -1574,7 +1574,11 @@ export default function App() {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() => setMarkdownPreview((value) => !value)}
|
onClick={() => setMarkdownPreview((value) => !value)}
|
||||||
>
|
>
|
||||||
{markdownPreview ? "Edit" : "Preview Markdown"}
|
{markdownPreview
|
||||||
|
? splitView
|
||||||
|
? "Hide Preview"
|
||||||
|
: "Edit"
|
||||||
|
: "Preview Markdown"}
|
||||||
</button>
|
</button>
|
||||||
<button className="button" onClick={handleExportText}>
|
<button className="button" onClick={handleExportText}>
|
||||||
Export Text
|
Export Text
|
||||||
|
|||||||
Reference in New Issue
Block a user