Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Chore/fix system theme bugs 2 (#17812)

Terry Sutton38a231bf3a4d
diff --git a/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx b/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx
index 573c5dd4673..62629d36713 100644
--- a/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx
+++ b/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx
@@ -301,12 +301,13 @@ function TableNode({ data, targetPosition, sourcePosition }: NodeProps<TableNode
}
const TablesGraph = ({ tables }: { tables: PostgresTable[] }) => {
- const { theme } = useTheme()
- const backgroundPatternColor = theme === 'dark' ? '#2e2e2e' : '#e6e8eb'
- const edgeStrokeColor = theme === 'dark' ? '#ededed' : '#111318'
+ const { resolvedTheme } = useTheme()
+ const backgroundPatternColor = resolvedTheme === 'dark' ? '#2e2e2e' : '#e6e8eb'
+ const edgeStrokeColor = resolvedTheme === 'dark' ? '#ededed' : '#111318'
const miniMapNodeColor = '#111318'
- const miniMapMaskColor = theme === 'dark' ? 'rgb(17, 19, 24, .8)' : 'rgb(237, 237, 237, .8)'
+ const miniMapMaskColor =
+ resolvedTheme === 'dark' ? 'rgb(17, 19, 24, .8)' : 'rgb(237, 237, 237, .8)'
const reactFlowInstance = useReactFlow()
const nodeTypes = useMemo(
@@ -322,7 +323,7 @@ const TablesGraph = ({ tables }: { tables: PostgresTable[] }) => {
reactFlowInstance.setEdges(edges)
setTimeout(() => reactFlowInstance.fitView({})) // it needs to happen during next event tick
})
- }, [tables, theme])
+ }, [tables, resolvedTheme])
return (
<>
diff --git a/studio/components/interfaces/Home/ExampleProject.tsx b/studio/components/interfaces/Home/ExampleProject.tsx
index a741aee4bca..b3be54260b2 100644
--- a/studio/components/interfaces/Home/ExampleProject.tsx
+++ b/studio/components/interfaces/Home/ExampleProject.tsx
@@ -11,7 +11,7 @@ interface ExampleProjectProps {
}
const ExampleProject = ({ framework, title, description, url }: ExampleProjectProps) => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
return (
<Link href={url}>
@@ -30,7 +30,7 @@ const ExampleProject = ({ framework, title, description, url }: ExampleProjectPr
className="transition-all group-hover:scale-110"
src={`${BASE_PATH}/img/libraries/${framework.toLowerCase()}${
['expo', 'nextjs'].includes(framework.toLowerCase())
- ? theme === 'dark'
+ ? resolvedTheme === 'dark'
? '-dark'
: ''
: ''