fix: reverted my changes on a file

This commit is contained in:
Dakshesh Jain 2023-08-17 13:59:39 +05:30
parent 963eeb0a8c
commit adcc9e75e8

View File

@ -19,32 +19,32 @@ export const EditorBubbleMenu: FC<EditorBubbleMenuProps> = (props) => {
const items: BubbleMenuItem[] = [ const items: BubbleMenuItem[] = [
{ {
name: "bold", name: "bold",
isActive: () => props?.editor?.isActive("bold")!, isActive: () => props.editor.isActive("bold"),
command: () => props?.editor?.chain().focus().toggleBold().run()!, command: () => props.editor.chain().focus().toggleBold().run(),
icon: BoldIcon, icon: BoldIcon,
}, },
{ {
name: "italic", name: "italic",
isActive: () => props?.editor?.isActive("italic")!, isActive: () => props.editor.isActive("italic"),
command: () => props?.editor?.chain().focus().toggleItalic().run()!, command: () => props.editor.chain().focus().toggleItalic().run(),
icon: ItalicIcon, icon: ItalicIcon,
}, },
{ {
name: "underline", name: "underline",
isActive: () => props?.editor?.isActive("underline")!, isActive: () => props.editor.isActive("underline"),
command: () => props?.editor?.chain().focus().toggleUnderline().run()!, command: () => props.editor.chain().focus().toggleUnderline().run(),
icon: UnderlineIcon, icon: UnderlineIcon,
}, },
{ {
name: "strike", name: "strike",
isActive: () => props?.editor?.isActive("strike")!, isActive: () => props.editor.isActive("strike"),
command: () => props?.editor?.chain().focus().toggleStrike().run()!, command: () => props.editor.chain().focus().toggleStrike().run(),
icon: StrikethroughIcon, icon: StrikethroughIcon,
}, },
{ {
name: "code", name: "code",
isActive: () => props?.editor?.isActive("code")!, isActive: () => props.editor.isActive("code"),
command: () => props?.editor?.chain().focus().toggleCode().run()!, command: () => props.editor.chain().focus().toggleCode().run(),
icon: CodeIcon, icon: CodeIcon,
}, },
]; ];
@ -78,7 +78,7 @@ export const EditorBubbleMenu: FC<EditorBubbleMenuProps> = (props) => {
className="flex w-fit divide-x divide-custom-border-300 rounded border border-custom-border-300 bg-custom-background-100 shadow-xl" className="flex w-fit divide-x divide-custom-border-300 rounded border border-custom-border-300 bg-custom-background-100 shadow-xl"
> >
<NodeSelector <NodeSelector
editor={props?.editor!} editor={props.editor}
isOpen={isNodeSelectorOpen} isOpen={isNodeSelectorOpen}
setIsOpen={() => { setIsOpen={() => {
setIsNodeSelectorOpen(!isNodeSelectorOpen); setIsNodeSelectorOpen(!isNodeSelectorOpen);
@ -86,7 +86,7 @@ export const EditorBubbleMenu: FC<EditorBubbleMenuProps> = (props) => {
}} }}
/> />
<LinkSelector <LinkSelector
editor={props?.editor!} editor={props.editor}
isOpen={isLinkSelectorOpen} isOpen={isLinkSelectorOpen}
setIsOpen={() => { setIsOpen={() => {
setIsLinkSelectorOpen(!isLinkSelectorOpen); setIsLinkSelectorOpen(!isLinkSelectorOpen);