File tree 1 file changed +12
-7
lines changed
packages/sanity/src/core/releases/tool/detail/documentTable
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ export const DocumentActions = memo(
68
68
t ,
69
69
] )
70
70
71
+ const isUnpublishActionDisabled =
72
+ noPermissionToUnpublish || ! document . document . publishedDocumentExists || isAlreadyUnpublished
73
+
71
74
return (
72
75
< >
73
76
< Card tone = "default" display = "flex" >
@@ -81,7 +84,10 @@ export const DocumentActions = memo(
81
84
icon = { CloseIcon }
82
85
onClick = { ( ) => setShowDiscardDialog ( true ) }
83
86
disabled = { isDiscardVersionActionDisabled }
84
- tooltipProps = { { content : t ( 'permissions.error.discard-version' ) } }
87
+ tooltipProps = { {
88
+ disabled : ! isDiscardVersionActionDisabled ,
89
+ content : t ( 'permissions.error.discard-version' ) ,
90
+ } }
85
91
/>
86
92
< MenuDivider />
87
93
< Box padding = { 3 } paddingBottom = { 2 } >
@@ -90,12 +96,11 @@ export const DocumentActions = memo(
90
96
< MenuItem
91
97
text = { t ( 'action.unpublish' ) }
92
98
icon = { UnpublishIcon }
93
- disabled = {
94
- noPermissionToUnpublish ||
95
- ! document . document . publishedDocumentExists ||
96
- isAlreadyUnpublished
97
- }
98
- tooltipProps = { { content : unPublishTooltipContent } }
99
+ disabled = { isUnpublishActionDisabled }
100
+ tooltipProps = { {
101
+ disabled : ! isUnpublishActionDisabled ,
102
+ content : unPublishTooltipContent ,
103
+ } }
99
104
onClick = { ( ) => setShowUnpublishDialog ( true ) }
100
105
/>
101
106
</ Menu >
You can’t perform that action at this time.
0 commit comments