fix: make onChange prop optional in Editor and rename markdown prop to content (#72)
This commit is contained in:
@@ -284,7 +284,7 @@ export default function Editor({
|
|||||||
readOnly = false,
|
readOnly = false,
|
||||||
}: {
|
}: {
|
||||||
content: string | null;
|
content: string | null;
|
||||||
onChange: (value: string) => void;
|
onChange?: (value: string) => void;
|
||||||
onBlur?: () => void;
|
onBlur?: () => void;
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
}) {
|
}) {
|
||||||
@@ -310,7 +310,7 @@ export default function Editor({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
content,
|
content,
|
||||||
onUpdate: ({ editor }) => onChange(editor.getHTML()),
|
onUpdate: ({ editor }) => onChange?.(editor.getHTML()),
|
||||||
onBlur: ({ event }) => {
|
onBlur: ({ event }) => {
|
||||||
if (
|
if (
|
||||||
document
|
document
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export function CardModal({
|
|||||||
{data?.description && (
|
{data?.description && (
|
||||||
<div className="mb-10 flex w-full max-w-2xl justify-between">
|
<div className="mb-10 flex w-full max-w-2xl justify-between">
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
<Editor markdown={data.description} readOnly />
|
<Editor content={data.description} readOnly />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user