Skip to content

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

Chore/update theme switcher (#17866)

Terry Sutton6a651a1837e8
diff --git a/studio/components/interfaces/BillingV2/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx b/studio/components/interfaces/BillingV2/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx
index 85d1e6ede23..5ec0e49617c 100644
--- a/studio/components/interfaces/BillingV2/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx
+++ b/studio/components/interfaces/BillingV2/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx
@@ -27,7 +27,7 @@ const AddNewPaymentMethodModal = ({
onConfirm,
}: AddNewPaymentMethodModalProps) => {
const { ui } = useStore()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const [intent, setIntent] = useState<any>()
const selectedOrganization = useSelectedOrganization()
@@ -90,7 +90,7 @@ const AddNewPaymentMethodModal = ({
const options = {
clientSecret: intent ? intent.client_secret : '',
- appearance: { theme: theme === 'dark' ? 'night' : 'flat', labels: 'floating' },
+ appearance: { theme: resolvedTheme === 'dark' ? 'night' : 'flat', labels: 'floating' },
} as any
const onLocalCancel = () => {
diff --git a/studio/components/interfaces/BillingV2/Subscription/AddOns/AddOns.tsx b/studio/components/interfaces/BillingV2/Subscription/AddOns/AddOns.tsx
index ddbefa3aaae..4be3cae904c 100644
--- a/studio/components/interfaces/BillingV2/Subscription/AddOns/AddOns.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/AddOns/AddOns.tsx
@@ -32,9 +32,10 @@ import { BASE_PATH } from 'lib/constants'
import { getSemanticVersion } from 'lib/helpers'
import { useSubscriptionPageStateSnapshot } from 'state/subscription-page'
import { getAddons } from '../Subscription.utils'
+import Image from 'next/image'
const AddOns = () => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const { ref: projectRef } = useParams()
const snap = useSubscriptionPageStateSnapshot()
const projectUpdateDisabled = useFlag('disableProjectCreationAndUpdate')
@@ -140,10 +141,10 @@ const AddOns = () => {
src={
computeInstance !== undefined
? `${BASE_PATH}/img/optimized-compute-on${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
: `${BASE_PATH}/img/optimized-compute-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
}
/>
@@ -309,8 +310,12 @@ const AddOns = () => {
height={96}
src={
pitr !== undefined
- ? `${BASE_PATH}/img/pitr-on${theme === 'dark' ? '' : '--light'}.png?v=2`
- : `${BASE_PATH}/img/pitr-off${theme === 'dark' ? '' : '--light'}.png?v=2`
+ ? `${BASE_PATH}/img/pitr-on${
+ resolvedTheme === 'dark' ? '' : '--light'
+ }.png?v=2`
+ : `${BASE_PATH}/img/pitr-off${
+ resolvedTheme === 'dark' ? '' : '--light'
+ }.png?v=2`
}
/>
</div>
@@ -363,17 +368,17 @@ const AddOns = () => {
<div className="flex space-x-6">
<div>
<div className="rounded-md bg-scale-100 dark:bg-scale-400 w-[160px] h-[96px] shadow">
- <img
+ <Image
alt="Custom Domain"
width={160}
height={96}
src={
customDomain !== undefined
? `${BASE_PATH}/img/custom-domain-on${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
: `${BASE_PATH}/img/custom-domain-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
}
/>
diff --git a/studio/components/interfaces/BillingV2/Subscription/CostControl/CostControl.tsx b/studio/components/interfaces/BillingV2/Subscription/CostControl/CostControl.tsx
index 42b1dc6e0c4..b302455ba62 100644
--- a/studio/components/interfaces/BillingV2/Subscription/CostControl/CostControl.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/CostControl/CostControl.tsx
@@ -9,6 +9,7 @@ import Link from 'next/link'
import { useSubscriptionPageStateSnapshot } from 'state/subscription-page'
import { Alert, Button, IconExternalLink } from 'ui'
import SpendCapSidePanel from './SpendCapSidePanel'
+import Image from 'next/image'
export interface CostControlProps {}
@@ -16,7 +17,7 @@ const CostControl = ({}: CostControlProps) => {
const { ref: projectRef } = useParams()
const snap = useSubscriptionPageStateSnapshot()
const projectUpdateDisabled = useFlag('disableProjectCreationAndUpdate')
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const { data: subscription, isLoading } = useProjectSubscriptionV2Query({ projectRef })
@@ -95,17 +96,17 @@ const CostControl = ({}: CostControlProps) => {
<div className="flex space-x-6">
<div>
<div className="rounded-md bg-scale-100 dark:bg-scale-400 w-[160px] h-[96px] shadow">
- <img
+ <Image
alt="Spend Cap"
width={160}
height={96}
src={
isUsageBillingEnabled
? `${BASE_PATH}/img/spend-cap-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png?v=3`
: `${BASE_PATH}/img/spend-cap-on${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png?v=3`
}
/>
diff --git a/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
index 928b9d1f802..5910f0e6598 100644
--- a/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
@@ -14,6 +14,7 @@ import { useEffect, useState } from 'react'
import { pricing } from 'shared-data/pricing'
import { useSubscriptionPageStateSnapshot } from 'state/subscription-page'
import { Alert, Button, Collapsible, IconChevronRight, IconExternalLink, SidePanel } from 'ui'
+import Image from 'next/image'
const SPEND_CAP_OPTIONS: {
name: string
@@ -39,7 +40,7 @@ const SpendCapSidePanel = () => {
const { ui } = useStore()
const router = useRouter()
const { ref: projectRef } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const [showUsageCosts, setShowUsageCosts] = useState(false)
const [selectedOption, setSelectedOption] = useState<'on' | 'off'>()
@@ -239,7 +240,7 @@ const SpendCapSidePanel = () => {
)
}}
>
- <img
+ <Image
alt="Spend Cap"
className={clsx(
'relative rounded-xl transition border bg-no-repeat bg-center bg-cover w-[160px] h-[96px]',
@@ -251,7 +252,7 @@ const SpendCapSidePanel = () => {
)}
width={160}
height={96}
- src={theme === 'dark' ? option.imageUrl : option.imageUrlLight}
+ src={resolvedTheme === 'dark' ? option.imageUrl : option.imageUrlLight}
/>
<p
diff --git a/studio/components/interfaces/Database/Wrappers/WrappersDisabledState.tsx b/studio/components/interfaces/Database/Wrappers/WrappersDisabledState.tsx
index 51ee54fabbc..8473cf4b604 100644
--- a/studio/components/interfaces/Database/Wrappers/WrappersDisabledState.tsx
+++ b/studio/components/interfaces/Database/Wrappers/WrappersDisabledState.tsx
@@ -13,7 +13,7 @@ import { BASE_PATH } from 'lib/constants'
const WrappersDisabledState = () => {
const { ui, meta } = useStore()
const { ref } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const wrappersExtension = meta.extensions.byId('wrappers')
const vaultExtension = meta.extensions.byId('supabase_vault')
const isNotAvailable = wrappersExtension === undefined || vaultExtension === undefined
@@ -72,7 +72,7 @@ const WrappersDisabledState = () => {
backgroundSize: '45%',
backgroundPosition: '105% 40%',
backgroundImage:
- theme === 'dark'
+ resolvedTheme === 'dark'
? `url("${BASE_PATH}/img/wrappers-dark.png")`
: `url("${BASE_PATH}/img/wrappers-light.png")`,
}}
diff --git a/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/CostControl.tsx b/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/CostControl.tsx
index 071b76ab2c2..26f2575fb0d 100644
--- a/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/CostControl.tsx
+++ b/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/CostControl.tsx
@@ -16,12 +16,13 @@ import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
import { Alert, Button, IconExternalLink } from 'ui'
import ProjectUpdateDisabledTooltip from '../../BillingSettings/ProjectUpdateDisabledTooltip'
import SpendCapSidePanel from './SpendCapSidePanel'
+import Image from 'next/image'
export interface CostControlProps {}
const CostControl = ({}: CostControlProps) => {
const { slug } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const snap = useOrgSettingsPageStateSnapshot()
const projectUpdateDisabled = useFlag('disableProjectCreationAndUpdate')
@@ -112,17 +113,17 @@ const CostControl = ({}: CostControlProps) => {
<div className="flex space-x-6">
<div>
<div className="rounded-md bg-scale-100 dark:bg-scale-400 w-[160px] h-[96px] shadow">
- <img
+ <Image
alt="Spend Cap"
width={160}
height={96}
src={
isUsageBillingEnabled
? `${BASE_PATH}/img/spend-cap-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png?v=3`
: `${BASE_PATH}/img/spend-cap-on${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png?v=3`
}
/>
diff --git a/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx b/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx
index 34dc4f9053f..c42e0d7f45b 100644
--- a/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx
+++ b/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx
@@ -14,6 +14,7 @@ import { useEffect, useState } from 'react'
import { pricing } from 'shared-data/pricing'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
import { Alert, Button, Collapsible, IconChevronRight, IconExternalLink, SidePanel } from 'ui'
+import Image from 'next/image'
const SPEND_CAP_OPTIONS: {
name: string
@@ -39,7 +40,7 @@ const SpendCapSidePanel = () => {
const { ui } = useStore()
const router = useRouter()
const { slug } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const [showUsageCosts, setShowUsageCosts] = useState(false)
const [selectedOption, setSelectedOption] = useState<'on' | 'off'>()
@@ -243,7 +244,7 @@ const SpendCapSidePanel = () => {
)
}}
>
- <img
+ <Image
alt="Spend Cap"
className={clsx(
'relative rounded-xl transition border bg-no-repeat bg-center bg-cover w-[160px] h-[96px]',
@@ -255,7 +256,7 @@ const SpendCapSidePanel = () => {
)}
width={160}
height={96}
- src={theme === 'dark' ? option.imageUrl : option.imageUrlLight}
+ src={resolvedTheme === 'dark' ? option.imageUrl : option.imageUrlLight}
/>
<p
diff --git a/studio/components/interfaces/Settings/Addons/Addons.tsx b/studio/components/interfaces/Settings/Addons/Addons.tsx
index 609b4d78fc4..4461975fb69 100644
--- a/studio/components/interfaces/Settings/Addons/Addons.tsx
+++ b/studio/components/interfaces/Settings/Addons/Addons.tsx
@@ -37,9 +37,10 @@ import {
IconExternalLink,
} from 'ui'
import { ComputeInstanceSidePanel, CustomDomainSidePanel, PITRSidePanel } from './'
+import Image from 'next/image'
const Addons = () => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const { ref: projectRef, panel } = useParams()
const snap = useSubscriptionPageStateSnapshot()
const projectUpdateDisabled = useFlag('disableProjectCreationAndUpdate')
@@ -168,17 +169,17 @@ const Addons = () => {
<div className="flex space-x-6">
<div>
<div className="rounded-md bg-scale-100 dark:bg-scale-400 w-[160px] h-[96px] shadow">
- <img
+ <Image
alt="Optimized Compute"
width={160}
height={96}
src={
computeInstance !== undefined
? `${BASE_PATH}/img/optimized-compute-on${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
: `${BASE_PATH}/img/optimized-compute-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
}
/>
@@ -363,15 +364,17 @@ const Addons = () => {
<div className="flex space-x-6">
<div>
<div className="rounded-md bg-scale-100 dark:bg-scale-400 w-[160px] h-[96px] shadow">
- <img
+ <Image
alt="Point-In-Time-Recovery"
width={160}
height={96}
src={
pitr !== undefined
- ? `${BASE_PATH}/img/pitr-on${theme === 'dark' ? '' : '--light'}.png?v=2`
+ ? `${BASE_PATH}/img/pitr-on${
+ resolvedTheme === 'dark' ? '' : '--light'
+ }.png?v=2`
: `${BASE_PATH}/img/pitr-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png?v=2`
}
/>
@@ -462,10 +465,10 @@ const Addons = () => {
src={
customDomain !== undefined
? `${BASE_PATH}/img/custom-domain-on${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
: `${BASE_PATH}/img/custom-domain-off${
- theme === 'dark' ? '' : '--light'
+ resolvedTheme === 'dark' ? '' : '--light'
}.png`
}
/>
diff --git a/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx b/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx
index 79ad6a58038..ffdb0959d20 100644
--- a/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx
+++ b/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx
@@ -21,6 +21,7 @@ import { useSubscriptionPageStateSnapshot } from 'state/subscription-page'
import { Alert, Button, IconExternalLink, IconInfo, Modal, Radio, SidePanel } from 'ui'
import * as Tooltip from '@radix-ui/react-tooltip'
+import Image from 'next/image'
const COMPUTE_CATEGORY_OPTIONS: {
id: 'micro' | 'optimized'
@@ -47,7 +48,7 @@ const ComputeInstanceSidePanel = () => {
const { ui } = useStore()
const router = useRouter()
const { ref: projectRef } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const { project: selectedProject } = useProjectContext()
const organization = useSelectedOrganization()
const isOrgBilling = !!organization?.subscription_id
@@ -226,7 +227,7 @@ const ComputeInstanceSidePanel = () => {
)
}}
>
- <img
+ <Image
alt="Compute Instance"
className={clsx(
'relative rounded-xl transition border bg-no-repeat bg-center bg-cover cursor-pointer w-[160px] h-[96px]',
@@ -236,7 +237,7 @@ const ComputeInstanceSidePanel = () => {
)}
width={160}
height={96}
- src={theme === 'dark' ? option.imageUrl : option.imageUrlLight}
+ src={resolvedTheme === 'dark' ? option.imageUrl : option.imageUrlLight}
/>
<p
diff --git a/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx b/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
index 7716aa4d01a..c6fcfaee2ee 100644
--- a/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
+++ b/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
@@ -41,7 +41,7 @@ const PITRSidePanel = () => {
const { ui } = useStore()
const router = useRouter()
const { ref: projectRef } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const organization = useSelectedOrganization()
const isOrgBilling = !!organization?.subscription_id
@@ -207,7 +207,7 @@ const PITRSidePanel = () => {
)}
width={160}
height={96}
- src={theme === 'dark' ? option.imageUrl : option.imageUrlLight}
+ src={resolvedTheme === 'dark' ? option.imageUrl : option.imageUrlLight}
/>
<p
diff --git a/studio/components/interfaces/Settings/Vault/VaultToggle.tsx b/studio/components/interfaces/Settings/Vault/VaultToggle.tsx
index 7d1a3bb4869..e7142e785f5 100644
--- a/studio/components/interfaces/Settings/Vault/VaultToggle.tsx
+++ b/studio/components/interfaces/Settings/Vault/VaultToggle.tsx
@@ -13,7 +13,7 @@ import { BASE_PATH } from 'lib/constants'
const VaultToggle = () => {
const { meta, ui } = useStore()
const { ref } = useParams()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const [isEnabling, setIsEnabling] = useState(false)
const canToggleVault = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'extensions')
@@ -65,7 +65,7 @@ const VaultToggle = () => {
backgroundSize: isNotAvailable ? '50%' : '40%',
backgroundPosition: '100% 24%',
backgroundImage:
- theme === 'dark'
+ resolvedTheme === 'dark'
? `url("${BASE_PATH}/img/vault-dark.png")`
: `url("${BASE_PATH}/img/vault-light.png")`,
}}
diff --git a/studio/components/interfaces/TableGridEditor/TableDefinition.tsx b/studio/components/interfaces/TableGridEditor/TableDefinition.tsx
index 17cf8859086..83e00cc868d 100644
--- a/studio/components/interfaces/TableGridEditor/TableDefinition.tsx
+++ b/studio/components/interfaces/TableGridEditor/TableDefinition.tsx
@@ -23,7 +23,7 @@ const TableDefinition = ({ id }: TableDefinitionProps) => {
const { ref } = useParams()
const editorRef = useRef(null)
const monacoRef = useRef(null)
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const entityType = useEntityType(id)
const { project } = useProjectContext()
@@ -113,7 +113,7 @@ const TableDefinition = ({ id }: TableDefinitionProps) => {
</Link>
<Editor
className="monaco-editor"
- theme={theme === 'dark' ? 'vs-dark' : 'vs'}
+ theme={resolvedTheme === 'dark' ? 'vs-dark' : 'vs'}
onMount={handleEditorOnMount}
defaultLanguage="pgsql"
value={formattedDefinition}
diff --git a/studio/components/layouts/APIAuthorizationLayout.tsx b/studio/components/layouts/APIAuthorizationLayout.tsx
index 01f2f041a87..c517fbcbce3 100644
--- a/studio/components/layouts/APIAuthorizationLayout.tsx
+++ b/studio/components/layouts/APIAuthorizationLayout.tsx
@@ -8,7 +8,7 @@ import Divider from 'components/ui/Divider'
export interface APIAuthorizationLayoutProps {}
const APIAuthorizationLayout = ({ children }: PropsWithChildren<APIAuthorizationLayoutProps>) => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
return (
<>
<Head>
@@ -23,7 +23,7 @@ const APIAuthorizationLayout = ({ children }: PropsWithChildren<APIAuthorization
<span className="sr-only">Supabase</span>
<Image
src={
- theme === 'dark'
+ resolvedTheme === 'dark'
? `${BASE_PATH}/img/supabase-dark.svg`
: `${BASE_PATH}/img/supabase-light.svg`
}
diff --git a/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx b/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx
index d15066e1e23..07b13f67f2b 100644
--- a/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx
+++ b/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx
@@ -19,7 +19,7 @@ const ForgotPasswordLayout = ({
showHeadings = true,
children,
}: PropsWithChildren<ForgotPasswordLayoutProps>) => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
return (
<div className="flex-1 bg-scale-200 flex flex-col gap-8 lg:gap-16 xl:gap-32">
@@ -31,7 +31,7 @@ const ForgotPasswordLayout = ({
<a>
<Image
src={
- theme === 'dark'
+ resolvedTheme === 'dark'
? `${BASE_PATH}/img/supabase-dark.svg`
: `${BASE_PATH}/img/supabase-light.svg`
}
diff --git a/studio/components/layouts/SignInLayout/SignInLayout.tsx b/studio/components/layouts/SignInLayout/SignInLayout.tsx
index 1ef3037277a..667de365b20 100644
--- a/studio/components/layouts/SignInLayout/SignInLayout.tsx
+++ b/studio/components/layouts/SignInLayout/SignInLayout.tsx
@@ -29,7 +29,7 @@ const SignInLayout = ({
const router = useRouter()
const pushNext = usePushNext()
const queryClient = useQueryClient()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const ongoingIncident = useFlag('ongoingIncident')
// This useEffect redirects the user to MFA if they're already halfway signed in
@@ -103,7 +103,7 @@ const SignInLayout = ({
<a>
<Image
src={
- theme === 'dark'
+ resolvedTheme === 'dark'
? `${BASE_PATH}/img/supabase-dark.svg`
: `${BASE_PATH}/img/supabase-light.svg`
}
diff --git a/studio/pages/404.tsx b/studio/pages/404.tsx
index e9e1030cd3d..3b011b04b6c 100644
--- a/studio/pages/404.tsx
+++ b/studio/pages/404.tsx
@@ -7,7 +7,7 @@ import { useTheme } from 'next-themes'
import { BASE_PATH } from 'lib/constants'
const Error404: NextPage = ({}) => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const [show404, setShow404] = useState<boolean>(false)
useEffect(() => {
@@ -26,7 +26,7 @@ const Error404: NextPage = ({}) => {
<a>
<Image
src={
- theme === 'dark'
+ resolvedTheme === 'dark'
? `${BASE_PATH}/img/supabase-dark.svg`
: `${BASE_PATH}/img/supabase-light.svg`
}
diff --git a/studio/pages/500.tsx b/studio/pages/500.tsx
index 21d865c5e14..9d0f491cf90 100644
--- a/studio/pages/500.tsx
+++ b/studio/pages/500.tsx
@@ -10,7 +10,7 @@ import { useTheme } from 'next-themes'
const Error500: NextPage = () => {
const router = useRouter()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const signOut = useSignOut()
const onClickLogout = async () => {
@@ -29,7 +29,7 @@ const Error500: NextPage = () => {
<a>
<Image
src={
- theme === 'dark'
+ resolvedTheme === 'dark'
? `${router.basePath}/img/supabase-dark.svg`
: `${router.basePath}/img/supabase-light.svg`
}
diff --git a/studio/pages/new/index.tsx b/studio/pages/new/index.tsx
index 7c4cb98f771..c9e52366a72 100644
--- a/studio/pages/new/index.tsx
+++ b/studio/pages/new/index.tsx
@@ -19,7 +19,7 @@ const stripePromise = loadStripe(STRIPE_PUBLIC_KEY)
* No org selected yet, create a new one
*/
const Wizard: NextPageWithLayout = () => {
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const [intent, setIntent] = useState<any>()
const captchaLoaded = useIsHCaptchaLoaded()
@@ -43,7 +43,7 @@ const Wizard: NextPageWithLayout = () => {
const options = {
clientSecret: intent ? intent.client_secret : '',
- appearance: { theme: theme === 'dark' ? 'night' : 'flat', labels: 'floating' },
+ appearance: { theme: resolvedTheme === 'dark' ? 'night' : 'flat', labels: 'floating' },
} as any
const loadPaymentForm = async () => {
diff --git a/studio/pages/project/[ref]/api/graphiql.tsx b/studio/pages/project/[ref]/api/graphiql.tsx
index 5726881f0e4..1263881bf39 100644
--- a/studio/pages/project/[ref]/api/graphiql.tsx
+++ b/studio/pages/project/[ref]/api/graphiql.tsx
@@ -17,8 +17,8 @@ import { NextPageWithLayout } from 'types'
const GraphiQLPage: NextPageWithLayout = () => {
const { ref: projectRef } = useParams()
const { ui, meta } = useStore()
- const { theme } = useTheme()
- const currentTheme = theme === 'dark' ? 'dark' : 'light'
+ const { resolvedTheme } = useTheme()
+ const currentTheme = resolvedTheme === 'dark' ? 'dark' : 'light'
const isExtensionsLoading = meta.extensions.isLoading
const pgGraphqlExtension = meta.extensions.byId('pg_graphql')
diff --git a/studio/pages/project/[ref]/editor/[id].tsx b/studio/pages/project/[ref]/editor/[id].tsx
index 5e9e4f30bde..2b8704ff696 100644
--- a/studio/pages/project/[ref]/editor/[id].tsx
+++ b/studio/pages/project/[ref]/editor/[id].tsx
@@ -10,7 +10,7 @@ import { NextPageWithLayout } from 'types'
const TableEditorPage: NextPageWithLayout = () => {
const router = useRouter()
- const { theme } = useTheme()
+ const { resolvedTheme } = useTheme()
const { id: _id, ref: projectRef } = useParams()
const id = _id ? Number(_id) : undefined
@@ -21,7 +21,7 @@ const TableEditorPage: NextPageWithLayout = () => {
<TableGridEditor
isLoadingSelectedTable={isLoading}
selectedTable={selectedTable}
- theme={theme === 'dark' ? 'dark' : 'light'}
+ theme={resolvedTheme === 'dark' ? 'dark' : 'light'}
/>
<DeleteConfirmationDialogs
projectRef={projectRef}