Skip to content

Commit 8c62408

Browse files
authored
Merge pull request #11160 from mjsarfatti/fix-confirm-warning-bg
[RFR] Fix Confirm warning hover background transparency
2 parents b3303e2 + 0b64370 commit 8c62408

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

packages/ra-ui-materialui/src/layout/Confirm.stories.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ export default {
66
title: 'ra-ui-materialui/layout/Confirm',
77
};
88

9-
export const BackClick = () => {
9+
export const BackClick = ({
10+
confirmColor,
11+
}: {
12+
confirmColor?: 'primary' | 'warning';
13+
}) => {
1014
const [isOpen, setIsOpen] = React.useState(false);
1115
const [isClicked, setIsClicked] = React.useState(false);
1216

@@ -35,11 +39,20 @@ export const BackClick = () => {
3539
title="Delete Item"
3640
content="Are you sure you want to delete this item?"
3741
confirm="Yes"
38-
confirmColor="primary"
42+
confirmColor={confirmColor}
3943
onConfirm={() => setIsOpen(false)}
4044
onClose={() => setIsOpen(false)}
4145
/>
4246
</div>
4347
</>
4448
);
4549
};
50+
BackClick.args = {
51+
confirmColor: 'primary',
52+
};
53+
BackClick.argTypes = {
54+
confirmColor: {
55+
control: { type: 'select' },
56+
options: ['primary', 'warning'],
57+
},
58+
};

packages/ra-ui-materialui/src/layout/Confirm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const StyledDialog = styled(Dialog, {
167167
[`& .${ConfirmClasses.confirmWarning}`]: {
168168
color: (theme.vars || theme).palette.error.main,
169169
'&:hover': {
170-
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.error.main}, transparent 12%)`,
170+
backgroundColor: `color-mix(in srgb, ${(theme.vars || theme).palette.error.main}, transparent 88%)`,
171171
// Reset on mouse devices
172172
'@media (hover: none)': {
173173
backgroundColor: 'transparent',

0 commit comments

Comments
 (0)