File tree Expand file tree Collapse file tree
packages/ra-ui-materialui/src/button Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export const DeleteWithConfirmButton = <RecordType extends RaRecord = any>(
3434 redirect = 'list' ,
3535 translateOptions = { } ,
3636 mutationOptions,
37+ color = 'error' ,
3738 ...rest
3839 } = props ;
3940 const translate = useTranslate ( ) ;
@@ -57,15 +58,16 @@ export const DeleteWithConfirmButton = <RecordType extends RaRecord = any>(
5758
5859 return (
5960 < Fragment >
60- < StyledButton
61+ < Button
6162 onClick = { handleDialogOpen }
6263 label = { label }
6364 className = { clsx ( 'ra-delete-button' , className ) }
6465 key = "button"
66+ color = { color }
6567 { ...rest }
6668 >
6769 { icon }
68- </ StyledButton >
70+ </ Button >
6971 < Confirm
7072 isOpen = { open }
7173 loading = { isLoading }
@@ -131,19 +133,3 @@ DeleteWithConfirmButton.propTypes = {
131133 icon : PropTypes . element ,
132134 translateOptions : PropTypes . object ,
133135} ;
134-
135- const PREFIX = 'RaDeleteWithConfirmButton' ;
136-
137- const StyledButton = styled ( Button , {
138- name : PREFIX ,
139- overridesResolver : ( props , styles ) => styles . root ,
140- } ) ( ( { theme } ) => ( {
141- color : theme . palette . error . main ,
142- '&:hover' : {
143- backgroundColor : alpha ( theme . palette . error . main , 0.12 ) ,
144- // Reset on mouse devices
145- '@media (hover: none)' : {
146- backgroundColor : 'transparent' ,
147- } ,
148- } ,
149- } ) ) ;
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export const DeleteWithUndoButton = <RecordType extends RaRecord = any>(
2727 onClick,
2828 redirect = 'list' ,
2929 mutationOptions,
30+ color = 'error' ,
3031 ...rest
3132 } = props ;
3233
@@ -41,16 +42,17 @@ export const DeleteWithUndoButton = <RecordType extends RaRecord = any>(
4142 } ) ;
4243
4344 return (
44- < StyledButton
45+ < Button
4546 onClick = { handleDelete }
4647 disabled = { isLoading }
4748 label = { label }
4849 className = { clsx ( 'ra-delete-button' , className ) }
4950 key = "button"
51+ color = { color }
5052 { ...rest }
5153 >
5254 { icon }
53- </ StyledButton >
55+ </ Button >
5456 ) ;
5557} ;
5658
@@ -84,19 +86,3 @@ DeleteWithUndoButton.propTypes = {
8486 resource : PropTypes . string ,
8587 icon : PropTypes . element ,
8688} ;
87-
88- const PREFIX = 'RaDeleteWithUndoButton' ;
89-
90- const StyledButton = styled ( Button , {
91- name : PREFIX ,
92- overridesResolver : ( props , styles ) => styles . root ,
93- } ) ( ( { theme } ) => ( {
94- color : theme . palette . error . main ,
95- '&:hover' : {
96- backgroundColor : alpha ( theme . palette . error . main , 0.12 ) ,
97- // Reset on mouse devices
98- '@media (hover: none)' : {
99- backgroundColor : 'transparent' ,
100- } ,
101- } ,
102- } ) ) ;
You can’t perform that action at this time.
0 commit comments