Skip to content

Commit

Permalink
refactor(schedule-publishing): move DocumentActionPropsContext to sin…
Browse files Browse the repository at this point in the history
…gletons
  • Loading branch information
binoy14 committed Apr 29, 2024
1 parent 684bb8a commit dab96b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {createContext} from 'react'

import type {DocumentActionProps} from '../../../core/config/document/actions'

/**
* @internal
*/
export const DocumentActionPropsContext = createContext<DocumentActionProps | undefined>(undefined)
1 change: 1 addition & 0 deletions packages/sanity/src/_singletons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export * from './core/form/studio/reviewChanges/ReviewChangesContext'
export * from './core/form/studio/ValidationContext'
export * from './core/i18n/LocaleContext'
export * from './core/presence/FormFieldPresenceContext'
export * from './core/schedulePublishing/DocumentActionPropsContext'
export * from './core/store/_legacy/ResourceCacheContext'
export * from './core/studio/activeWorkspaceMatcher/ActiveWorkspaceMatcherContext'
export * from './core/studio/addonDataset/AddonDatasetContext'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import {createContext, type ReactNode, useContext} from 'react'
import {type ReactNode, useContext} from 'react'
import {DocumentActionPropsContext} from 'sanity/_singletons'

import {type DocumentActionProps} from '../../config/document/actions'

type State = DocumentActionProps

const DocumentActionPropsContext = createContext<State | undefined>(undefined)

function DocumentActionPropsProvider({
children,
value,
Expand Down

0 comments on commit dab96b5

Please sign in to comment.