Skip to content

Commit 050012c

Browse files
committed
fix: darkmode bug with modals
1 parent f1178dd commit 050012c

File tree

4 files changed

+482
-472
lines changed

4 files changed

+482
-472
lines changed

src/components/databrowser/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { TooltipProvider } from "@radix-ui/react-tooltip"
1010
import { QueryClientProvider } from "@tanstack/react-query"
1111

1212
import { queryClient } from "@/lib/clients"
13+
import { portalWrapper } from "@/lib/portal-root"
1314

1415
import { DatabrowserInstance } from "./components/databrowser-instance"
1516
import { DatabrowserTabs } from "./components/databrowser-tabs"
@@ -90,15 +91,22 @@ const RedisBrowserRoot = ({
9091
}) => {
9192
const theme = useDarkMode()
9293

94+
useEffect(() => {
95+
portalWrapper.classList.add("text-zinc-700")
96+
portalWrapper.classList.toggle("dark", theme === "dark")
97+
}, [theme])
98+
9399
return (
94100
/* ups-db is the custom class used to prefix every style in the css bundle */
95101
<div
96102
className={`ups-db ${theme === "dark" ? "dark" : ""}`}
97103
style={{ height: "100%", display: "flex", flexDirection: "column" }}
98104
ref={rootRef}
99105
>
100-
{!hideTabs && <DatabrowserTabs />}
101-
<DatabrowserInstances />
106+
<div className="text-zinc-700">
107+
{!hideTabs && <DatabrowserTabs />}
108+
<DatabrowserInstances />
109+
</div>
102110
</div>
103111
)
104112
}

0 commit comments

Comments
 (0)