mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 09:32:40 +10:00
fix: add drawio dark mode support
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react';
|
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 { useRef, useState } from 'react';
|
||||||
import { uploadFile } from '@/features/page/services/page-service.ts';
|
import { uploadFile } from '@/features/page/services/page-service.ts';
|
||||||
import { useDisclosure } from '@mantine/hooks';
|
import { useDisclosure } from '@mantine/hooks';
|
||||||
@ -21,6 +21,7 @@ export default function DrawioView(props: NodeViewProps) {
|
|||||||
const drawioRef = useRef<DrawIoEmbedRef>(null);
|
const drawioRef = useRef<DrawIoEmbedRef>(null);
|
||||||
const [initialXML, setInitialXML] = useState<string>('');
|
const [initialXML, setInitialXML] = useState<string>('');
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
|
const computedColorScheme = useComputedColorScheme();
|
||||||
|
|
||||||
const handleOpen = async () => {
|
const handleOpen = async () => {
|
||||||
if (!editor.isEditable) {
|
if (!editor.isEditable) {
|
||||||
@ -87,7 +88,7 @@ export default function DrawioView(props: NodeViewProps) {
|
|||||||
ref={drawioRef}
|
ref={drawioRef}
|
||||||
xml={initialXML}
|
xml={initialXML}
|
||||||
urlParameters={{
|
urlParameters={{
|
||||||
ui: 'kennedy',
|
ui: computedColorScheme === 'light' ? 'kennedy' : 'dark',
|
||||||
spin: true,
|
spin: true,
|
||||||
libraries: true,
|
libraries: true,
|
||||||
saveAndExit: true,
|
saveAndExit: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user