fix: add drawio dark mode support
This commit is contained in:
parent
31feb38def
commit
a52c86a180
1 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react';
|
||||
import { ActionIcon, Card, Image, Modal, Text } from '@mantine/core';
|
||||
import { ActionIcon, Card, Image, Modal, Text, useComputedColorScheme } from '@mantine/core';
|
||||
import { useRef, useState } from 'react';
|
||||
import { uploadFile } from '@/features/page/services/page-service.ts';
|
||||
import { useDisclosure } from '@mantine/hooks';
|
||||
|
|
@ -21,6 +21,7 @@ export default function DrawioView(props: NodeViewProps) {
|
|||
const drawioRef = useRef<DrawIoEmbedRef>(null);
|
||||
const [initialXML, setInitialXML] = useState<string>('');
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const computedColorScheme = useComputedColorScheme();
|
||||
|
||||
const handleOpen = async () => {
|
||||
if (!editor.isEditable) {
|
||||
|
|
@ -87,7 +88,7 @@ export default function DrawioView(props: NodeViewProps) {
|
|||
ref={drawioRef}
|
||||
xml={initialXML}
|
||||
urlParameters={{
|
||||
ui: 'kennedy',
|
||||
ui: computedColorScheme === 'light' ? 'kennedy' : 'dark',
|
||||
spin: true,
|
||||
libraries: true,
|
||||
saveAndExit: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue