style: issue details page, feat: add to cycles

This commit is contained in:
Aaryan Khandelwal 2022-11-29 19:49:39 +05:30
parent 0bfb0a136a
commit 9727994c08
46 changed files with 2349 additions and 600 deletions

View file

@ -0,0 +1,11 @@
import { useEffect } from "react";
import { registerCodeHighlighting } from "@lexical/code";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
export const CodeHighlightPlugin = () => {
const [editor] = useLexicalComposerContext();
useEffect(() => {
return registerCodeHighlighting(editor);
}, [editor]);
return null;
};

View file

@ -0,0 +1,21 @@
import { useEffect, useState } from "react";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
import { getValidatedValue } from "../helpers/editor";
const ReadOnlyPlugin = ({ value }: { value: string }) => {
const [editor] = useLexicalComposerContext();
useEffect(() => {
if (editor && value) {
const initialEditorState = editor?.parseEditorState(
getValidatedValue(value) || ""
);
editor.setEditorState(initialEditorState);
}
}, [editor, value]);
return <></>;
};
export default ReadOnlyPlugin;