-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sanity): add "Compare versions" document action to releases plugin
The action doesn't do anything yet.
- Loading branch information
Showing
2 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/sanity/src/core/releases/plugin/documentActions/CompareVersionsAction.tsx
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,20 @@ | ||
import {TransferIcon} from '@sanity/icons' | ||
import {useMemo} from 'react' | ||
|
||
import {type ActionComponent, type DocumentActionProps} from '../../../config' | ||
import {useTranslation} from '../../../i18n' | ||
import {releasesLocaleNamespace} from '../../i18n' | ||
|
||
export const CompareVersionsAction: ActionComponent<DocumentActionProps> = () => { | ||
const {t} = useTranslation(releasesLocaleNamespace) | ||
|
||
return useMemo( | ||
() => ({ | ||
icon: TransferIcon, | ||
label: t('action.compare-versions'), | ||
title: t('actions.create.text'), | ||
group: ['paneActions'], | ||
}), | ||
[t], | ||
) | ||
} |
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