@@ -176,29 +176,51 @@ export const PgIconButton = forwardRef(({icon, title, shortcut, className, split
176176 shortcutTitle = < ShortcutTitle title = { title } accesskey = { accesskey } shortcut = { shortcut } /> ;
177177 }
178178
179- if ( color == 'primary' ) {
179+ if ( props . disabled ) {
180+ if ( color == 'primary' ) {
181+ return (
182+ < Tooltip title = { shortcutTitle || title || '' } aria-label = { title || '' } enterDelay = { isDropdown ? 1500 : undefined } placement = { tooltipPlacement } >
183+ < span >
184+ < PrimaryButton ref = { ref } style = { style }
185+ className = { [ 'Buttons-iconButton' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
186+ accessKey = { accesskey } data-label = { title || '' } { ...props } >
187+ { icon }
188+ </ PrimaryButton >
189+ </ span >
190+ </ Tooltip >
191+ ) ;
192+ } else {
193+ return (
194+ < Tooltip title = { shortcutTitle || title || '' } aria-label = { title || '' } enterDelay = { isDropdown ? 1500 : undefined } placement = { tooltipPlacement } >
195+ < span >
196+ < DefaultButton ref = { ref } style = { style }
197+ className = { [ 'Buttons-iconButton' , 'Buttons-iconButtonDefault' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
198+ accessKey = { accesskey } data-label = { title || '' } { ...props } >
199+ { icon }
200+ </ DefaultButton >
201+ </ span >
202+ </ Tooltip >
203+ ) ;
204+ }
205+ } else if ( color == 'primary' ) {
180206 return (
181207 < Tooltip title = { shortcutTitle || title || '' } aria-label = { title || '' } enterDelay = { isDropdown ? 1500 : undefined } placement = { tooltipPlacement } >
182- < span >
183- < PrimaryButton ref = { ref } style = { style }
184- className = { [ 'Buttons-iconButton' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
185- accessKey = { accesskey } data-label = { title || '' } { ...props } >
186- { icon }
187- </ PrimaryButton >
188- </ span >
208+ < PrimaryButton ref = { ref } style = { style }
209+ className = { [ 'Buttons-iconButton' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
210+ accessKey = { accesskey } data-label = { title || '' } { ...props } >
211+ { icon }
212+ </ PrimaryButton >
189213 </ Tooltip >
190214
191215 ) ;
192216 } else {
193217 return (
194218 < Tooltip title = { shortcutTitle || title || '' } aria-label = { title || '' } enterDelay = { isDropdown ? 1500 : undefined } placement = { tooltipPlacement } >
195- < span >
196- < DefaultButton ref = { ref } style = { style }
197- className = { [ 'Buttons-iconButton' , 'Buttons-iconButtonDefault' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
198- accessKey = { accesskey } data-label = { title || '' } { ...props } >
199- { icon }
200- </ DefaultButton >
201- </ span >
219+ < DefaultButton ref = { ref } style = { style }
220+ className = { [ 'Buttons-iconButton' , 'Buttons-iconButtonDefault' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
221+ accessKey = { accesskey } data-label = { title || '' } { ...props } >
222+ { icon }
223+ </ DefaultButton >
202224 </ Tooltip >
203225 ) ;
204226 }
0 commit comments