Skip to content

Commit 784f7f5

Browse files
committed
fix: changed preview function to show actual content when 'showInDesignMode' is false
1 parent 0af3e24 commit 784f7f5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Notehing.editorPreview.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { NotehingPreviewProps } from "../typings/NotehingProps";
33

44
export function preview(props: NotehingPreviewProps): ReactElement {
55
const { noteTitle, noteContent, noteStyle, isContainer, content, showInDesignMode } = props;
6-
7-
if (!showInDesignMode) {
8-
return <div />;
9-
}
106

117
const ContentRenderer = isContainer && content? content.renderer : null;
128

9+
if (!showInDesignMode) {
10+
if (ContentRenderer) {
11+
return <ContentRenderer>{}<div /></ContentRenderer>;
12+
}
13+
}
14+
1315
const noteClassName = `note-preview note-${noteStyle}`;
1416

1517
return (

0 commit comments

Comments
 (0)