-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(core): rename commentSetup to addonDataset
- Loading branch information
1 parent
033bf37
commit 5b65ebc
Showing
15 changed files
with
64 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
packages/sanity/src/core/studio/addOnDataset/setup/CommentsSetupContext.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
packages/sanity/src/core/studio/addOnDataset/setup/useCommentsSetup.ts
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
packages/sanity/src/core/studio/addonDataset/AddonDatasetContext.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {createContext} from 'react' | ||
|
||
import {type AddonDatasetContextValue} from './types' | ||
|
||
/** | ||
* @beta | ||
* @hidden | ||
*/ | ||
export const AddonDatasetContext = createContext<AddonDatasetContextValue | null>(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './AddonDatasetContext' | ||
export * from './AddonDatasetProvider' | ||
export * from './types' | ||
export * from './useAddonDataset' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/sanity/src/core/studio/addonDataset/useAddonDataset.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {useContext} from 'react' | ||
|
||
import {AddonDatasetContext} from './AddonDatasetContext' | ||
import {type AddonDatasetContextValue} from './types' | ||
|
||
/** | ||
* @beta | ||
* @hidden | ||
*/ | ||
export function useAddonDataset(): AddonDatasetContextValue { | ||
const ctx = useContext(AddonDatasetContext) | ||
|
||
if (!ctx) { | ||
throw new Error('useAddonDataset: missing context value') | ||
} | ||
|
||
return ctx | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters