Skip to content

Commit

Permalink
refactor(core): move UserColorManagerContext to singletons
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 committed Apr 29, 2024
1 parent 7e3775d commit 548952e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/sanity/src/_singletons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ export * from './studio/router/RouterHistoryContext'
export * from './studio/SourceContext'
export * from './studio/WorkspaceContext'
export * from './studio/workspaces/WorkspacesContext'
export * from './user-color/UserColorManagerContext'
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {createContext} from 'react'

import {type UserColorManager} from './types'
import type {UserColorManager} from 'sanity'

export const UserColorManagerContext = createContext<UserColorManager | null>(null)
2 changes: 1 addition & 1 deletion packages/sanity/src/core/user-color/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {useContext} from 'react'
import {useMemoObservable} from 'react-rx'
import {EMPTY} from 'rxjs'
import {UserColorManagerContext} from 'sanity/_singletons'

import {UserColorManagerContext} from './context'
import {type UserColor, type UserColorManager} from './types'

/** @internal */
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/user-color/provider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type ReactElement, type ReactNode, useMemo} from 'react'
import {UserColorManagerContext} from 'sanity/_singletons'

import {useColorScheme} from '../studio'
import {UserColorManagerContext} from './context'
import {createUserColorManager} from './manager'
import {type UserColorManager} from './types'

Expand Down

0 comments on commit 548952e

Please sign in to comment.