From 72e51bb072a0a9daac915f7daf7d27f6ef3f2a2a Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Tue, 6 May 2025 04:38:38 +0530 Subject: [PATCH] (feat:mermaid) dont pass isDarkTheme --- frontend/src/components/MermaidRenderer.tsx | 3 ++- frontend/src/components/types/index.ts | 1 - frontend/src/conversation/ConversationBubble.tsx | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/MermaidRenderer.tsx b/frontend/src/components/MermaidRenderer.tsx index ef3e9222..ac37cfb4 100644 --- a/frontend/src/components/MermaidRenderer.tsx +++ b/frontend/src/components/MermaidRenderer.tsx @@ -6,11 +6,12 @@ import { oneLight, vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/ import { MermaidRendererProps } from './types'; import { useSelector } from 'react-redux'; import { selectStatus } from '../conversation/conversationSlice'; +import { useDarkTheme } from '../hooks'; const MermaidRenderer: React.FC = ({ code, - isDarkTheme, }) => { + const [isDarkTheme] = useDarkTheme(); const diagramId = useRef(`mermaid-${crypto.randomUUID()}`); const status = useSelector(selectStatus); const [error, setError] = useState(null); diff --git a/frontend/src/components/types/index.ts b/frontend/src/components/types/index.ts index 7f8834bb..25dae251 100644 --- a/frontend/src/components/types/index.ts +++ b/frontend/src/components/types/index.ts @@ -26,5 +26,4 @@ export type InputProps = { export type MermaidRendererProps = { code: string; - isDarkTheme: boolean; }; diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 0a0d0780..67cc1c34 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -490,7 +490,6 @@ const ConversationBubble = forwardRef< ) : (