Skip to content

Commit c785158

Browse files
authored
fix: enhance MiniMap display for dark mode (#29)
1 parent ee11246 commit c785158

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

frontend/src/components/canvas-view.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {
5252
import { database } from "../../wailsjs/go/models";
5353
import { useSystemInfo } from "@/hooks/use-system-info";
5454
import { cn } from "@/lib/utils";
55+
import { useTheme } from "./theme-provider";
5556

5657
interface CanvasViewProps {
5758
project: database.Project;
@@ -64,6 +65,8 @@ const initialEdges: Edge[] = [];
6465
function CanvasEditor({ project, onBack }: CanvasViewProps) {
6566
const { _ } = useLingui();
6667
const { systemInfo } = useSystemInfo();
68+
const { theme } = useTheme();
69+
const isDarkMode = theme === "dark";
6770
const [name, setName] = useState(project.name);
6871
const [isChatOpen, setIsChatOpen] = useState(false);
6972
const [chatMessage, setChatMessage] = useState("");
@@ -580,7 +583,15 @@ function CanvasEditor({ project, onBack }: CanvasViewProps) {
580583
maxZoom={2}
581584
proOptions={{ hideAttribution: true }}
582585
>
583-
<MiniMap pannable zoomable />
586+
<MiniMap
587+
pannable
588+
zoomable
589+
bgColor={isDarkMode ? "#18181b" : "#ffffff"}
590+
maskColor={
591+
isDarkMode ? "rgba(0, 0, 0, 0.6)" : "rgba(0, 0, 0, 0.1)"
592+
}
593+
nodeColor={isDarkMode ? "#52525b" : "#e4e4e7"}
594+
/>
584595
<Background
585596
className="dark:opacity-30"
586597
variant={BackgroundVariant.Dots}

0 commit comments

Comments
 (0)