Skip to content

Commit cfc75c1

Browse files
committed
feat: add wordpress
1 parent a9c6fc6 commit cfc75c1

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

apps/frontend/src/components/new-launch/editor.tsx

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ export const EditorWrapper: FC<{
198198
setLoaded(true);
199199
}, [loaded, loadedState]);
200200

201-
useEffect(() => {
202-
if (editor) {
203-
setLoaded(false);
204-
setLoadedState(false);
205-
}
206-
}, [editor]);
207-
208201
const canEdit = useMemo(() => {
209202
return current === 'global' || !!internal;
210203
}, [current, internal]);
@@ -724,29 +717,6 @@ export const OnlyEditor = forwardRef<
724717
paste?: (event: ClipboardEvent | File[]) => void;
725718
}
726719
>(({ editorType, value, onChange, paste }, ref) => {
727-
const editorOptions = useMemo(() => {
728-
if (editorType === 'normal') {
729-
return [];
730-
}
731-
732-
const list = [];
733-
734-
if (
735-
editorType === ('markdown' as const) ||
736-
editorType === ('html' as const)
737-
) {
738-
list.push(
739-
BulletList,
740-
ListItem,
741-
Heading.configure({
742-
levels: [1, 2, 3],
743-
})
744-
);
745-
}
746-
747-
return list;
748-
}, [editorType]);
749-
750720
const editor = useEditor({
751721
extensions: [
752722
Document,
@@ -757,11 +727,15 @@ export const OnlyEditor = forwardRef<
757727
InterceptBoldShortcut,
758728
InterceptUnderlineShortcut,
759729
Span,
730+
BulletList,
731+
ListItem,
732+
Heading.configure({
733+
levels: [1, 2, 3],
734+
}),
760735
History.configure({
761736
depth: 100, // default is 100
762737
newGroupDelay: 100, // default is 500ms
763738
}),
764-
...editorOptions,
765739
],
766740
content: value || '',
767741
shouldRerenderOnTransaction: true,

0 commit comments

Comments
 (0)