Skip to content

Commit

Permalink
perf: more friendly Json format in document editor
Browse files Browse the repository at this point in the history
  • Loading branch information
riccox committed Mar 15, 2023
1 parent fb3b2f9 commit 2a2b8a8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/index/documents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,16 @@ export const Documents = () => {
radius="lg"
shadow="xl"
padding="xl"
size="xl"
withCloseButton={true}
title={<p className={`font-bold text-lg`}>Add New Documents</p>}
>
<form className={`flex flex-col gap-y-4 w-full`} onSubmit={addDocumentsForm.onSubmit(onAddDocumentsSubmit)}>
<div className={`border rounded-xl p-2`}>
<MonacoEditor
language="json"
className="h-40"
defaultValue={String(addDocumentsForm.values.documents)}
className="h-80"
defaultValue={JSON.stringify(addDocumentsForm.values.documents, null, 2)}
options={{
automaticLayout: true,
lineDecorationsWidth: 1,
Expand All @@ -433,15 +434,16 @@ export const Documents = () => {
radius="lg"
shadow="xl"
padding="xl"
size="xl"
withCloseButton={true}
title={<p className={`font-bold text-lg`}>Edit Document</p>}
>
<div className={`flex flex-col gap-y-4 w-full`}>
<div className={`border rounded-xl p-2`}>
<MonacoEditor
language="json"
className="h-40"
defaultValue={JSON.stringify(editingDocument ?? {})}
className="h-80"
defaultValue={JSON.stringify(editingDocument ?? {}, null, 2)}
options={{
automaticLayout: true,
lineDecorationsWidth: 1,
Expand Down

1 comment on commit 2a2b8a8

@vercel
Copy link

@vercel vercel bot commented on 2a2b8a8 Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.