@@ -88,12 +88,13 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
88
88
isSeparator : action . isSeparator ,
89
89
isTitle : action . isTitle ,
90
90
danger : isDeleteAction ,
91
+ disabled : action . disabled ,
91
92
} }
92
93
name = 'actionButton'
93
94
>
94
- < Elem name = 'titleContainer' >
95
+ < Elem name = 'titleContainer' { ... ( action . disabled ? { title : action . disabledReason } : { } ) } >
95
96
< Elem name = 'title' > { action . title } </ Elem >
96
- { hasChildren ? < Elem name = 'icon' tag = { FaChevronRight } /> : null }
97
+ { ( hasChildren && ! action . disabled ) ? < Elem name = 'icon' tag = { FaChevronRight } /> : null }
97
98
</ Elem >
98
99
</ Block >
99
100
) ;
@@ -104,7 +105,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
104
105
align = "top-right-outside"
105
106
toggle = { false }
106
107
ref = { submenuRef }
107
- content = { < Block name = 'actionButton-submenu' tag = "ul" mod = { { newUI : isNewUI } } > { action . children . map ( ActionButton , parentRef ) } </ Block > }
108
+ content = { < Block name = 'actionButton-submenu' tag = "ul" mod = { { newUI : isNewUI } } > { ( ! action . disabled ) && action . children . map ( ActionButton , parentRef ) } </ Block > }
108
109
>
109
110
{ titleContainer }
110
111
</ Dropdown . Trigger >
@@ -125,8 +126,9 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
125
126
key = { action . id }
126
127
danger = { isDeleteAction }
127
128
onClick = { onClick }
128
- className = { `actionButton${ action . isSeparator ? "_isSeparator" : ( action . isTitle ? "_isTitle" : "" ) } ` }
129
+ className = { `actionButton${ action . isSeparator ? "_isSeparator" : ( action . isTitle ? "_isTitle" : "" ) } ${ ( action . disabled ) ? "actionButton_disabled" : "" } ` }
129
130
icon = { isDeleteAction && < FaTrash /> }
131
+ title = { action . disabled ? action . disabledReason : null }
130
132
>
131
133
{ action . title }
132
134
</ Menu . Item >
0 commit comments