Skip to content

Commit

Permalink
chore: use default theme from @sanity/ui
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jan 8, 2023
1 parent f8bccde commit 8bae11f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -158,6 +158,7 @@
"@sanity/image-url": "^1.0.1",
"@sanity/pkg-utils": "^2.1.1",
"@sanity/semantic-release-preset": "^3.0.0",
"@sanity/ui": "^1.0.12",
"@sanity/vision": "^3.1.4",
"@testing-library/react-hooks": "^8.0.1",
"@types/eventsource": "^1.1.10",
Expand Down
5 changes: 3 additions & 2 deletions src/studio/useTheme.ts
@@ -1,5 +1,6 @@
import {studioTheme} from '@sanity/ui'
import {useMemo} from 'react'
import {type Config, type SingleWorkspace, type StudioTheme, defaultTheme} from 'sanity'
import type {Config, SingleWorkspace, StudioTheme} from 'sanity'

/** @alpha */
export function useTheme(
Expand All @@ -8,5 +9,5 @@ export function useTheme(
const workspace = useMemo<
SingleWorkspace | Required<Pick<SingleWorkspace, 'theme'>> | undefined
>(() => (Array.isArray(config) ? config[0] : config), [config])
return useMemo<StudioTheme>(() => workspace?.theme || defaultTheme, [workspace])
return useMemo<StudioTheme>(() => workspace?.theme || studioTheme, [workspace])
}

0 comments on commit 8bae11f

Please sign in to comment.