feat: two column editor

This commit is contained in:
DIYgod
2022-09-13 03:16:25 +01:00
parent 9dd09b2cbb
commit 46f62258b8
2 changed files with 14 additions and 9 deletions
+3 -1
View File
@@ -296,7 +296,9 @@ export const PagesManager: React.FC<{
content: evt.target.result,
published: false,
publishedAt: (
pageContent.frontMatter.date || new Date()
pageContent.frontMatter.date ||
file.lastModifiedDate ||
new Date()
).toISOString(),
slug:
pageContent.frontMatter.permalink ||
+11 -8
View File
@@ -244,8 +244,8 @@ export default function SubdomainEditor() {
</header>
<div className="h-screen pt-14 flex w-full">
<div className="h-full overflow-auto w-full">
<div className="h-full max-w-screen-md mx-auto py-5 px-5 flex flex-col">
<div className="h-12">
<div className="h-full mx-auto py-5 flex flex-col">
<div className="px-5 h-12">
<input
type="text"
name="title"
@@ -260,12 +260,15 @@ export default function SubdomainEditor() {
placeholder="Title goes here.."
/>
</div>
<div className="mt-5 flex-1">
{previewVisible ? (
<EditorPreview content={content}></EditorPreview>
) : (
<div className="h-full" ref={editorRef}></div>
)}
<div className="mt-5 flex-1 flex">
<div
className="px-5 h-full border-r w-1/2"
ref={editorRef}
></div>
<EditorPreview
className="px-5 w-1/2"
content={content}
></EditorPreview>
</div>
</div>
</div>