mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-20 21:49:32 +01:00
fix: do not reload editor on theme change
This commit is contained in:
@@ -18,8 +18,8 @@ import {
|
||||
import { ReactNodeView } from "./react-node-view";
|
||||
import { NodeViewRendererProps } from "@tiptap/core";
|
||||
import { Theme } from "@notesnook/theme";
|
||||
import { ThemeProvider } from "emotion-theming";
|
||||
import { Editor } from "../../types";
|
||||
import { ThemeProvider } from "../../components/theme-provider";
|
||||
|
||||
/**
|
||||
* A ReactNodeView that handles React components sensitive
|
||||
@@ -76,13 +76,12 @@ export class SelectionBasedNodeView<
|
||||
forwardRef?: ForwardRef
|
||||
): React.ReactElement<any> | null {
|
||||
if (!this.options.component) return null;
|
||||
const theme = this.editor.storage.theme as Theme;
|
||||
const isSelected =
|
||||
this.editor.isEditable &&
|
||||
(this.insideSelection() || this.nodeInsideSelection());
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={theme}>
|
||||
<ThemeProvider>
|
||||
<this.options.component
|
||||
{...props}
|
||||
editor={this.editor}
|
||||
|
||||
Reference in New Issue
Block a user