From fd9d30e4fb3fcc6c6998eb452cd1c8886216025c Mon Sep 17 00:00:00 2001 From: Jordan Lawrence Date: Wed, 11 Dec 2024 12:58:16 +0000 Subject: [PATCH] refactor: simplifying method to generate perspective list state --- .../header/perspective/DocumentPerspectiveList.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx b/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx index 32b0034ff94..df3a5201870 100644 --- a/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx +++ b/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx @@ -124,7 +124,7 @@ export const DocumentPerspectiveList = memo(function DocumentPerspectiveList() { return !editState?.published }, [editState?.liveEdit, editState?.published]) - const getIsReleaseSelected = useCallback( + const getReleaseChipState = useCallback( (release: ReleaseDocument): {selected: boolean; disabled?: boolean} => { if (!params?.historyVersion) return {selected: release.name === getVersionFromId(displayed?._id || '')} @@ -243,9 +243,7 @@ export const DocumentPerspectiveList = memo(function DocumentPerspectiveList() { } - {...getIsReleaseSelected(release)} - // selected - // disabled={false} + {...getReleaseChipState(release)} onClick={handleBundleChange(release.name)} text={release.metadata.title || t('release.placeholder-untitled-release')} tone={getReleaseTone(release)}