Skip to content

Commit 963ef55

Browse files
committed
remove useless code in DeletButtonStories
1 parent 30af6da commit 963ef55

1 file changed

Lines changed: 14 additions & 32 deletions

File tree

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,37 @@
11
import * as React from 'react';
22
import { createTheme } from '@mui/material';
3-
import type { PaletteColor } from '@mui/material';
43
import { DeleteButton } from './DeleteButton';
5-
import { Form } from 'ra-core';
64
import { AdminContext } from '../AdminContext';
75

86
export default { title: 'ra-ui-materialui/button/DeleteButton' };
97

108
export const Basic = () => (
119
<AdminContext>
12-
<Form record={{ id: 1 }}>
13-
<DeleteButton label="Delete" />
14-
</Form>
10+
<DeleteButton label="Delete" record={{ id: 1 }} />
11+
</AdminContext>
12+
);
13+
14+
export const Pessimistic = () => (
15+
<AdminContext>
16+
<DeleteButton
17+
mutationMode="pessimistic"
18+
record={{ id: 1 }}
19+
label="Delete"
20+
resource="post"
21+
/>
1522
</AdminContext>
1623
);
1724

1825
export const WithUserDefinedPalette = () => (
1926
<AdminContext theme={theme}>
20-
<Form record={{ id: 1 }}>
21-
<DeleteButton label="Delete" />
22-
</Form>
27+
<DeleteButton label="Delete" record={{ id: 1 }} />
2328
</AdminContext>
2429
);
2530

26-
/**
27-
* Adding new theme tokens to the palette
28-
* @see https://mui.com/material-ui/experimental-api/css-theme-variables/customization/#typescript
29-
*/
3031
const theme = createTheme({
3132
palette: {
3233
error: {
33-
main: '#FDDBD3',
34+
main: '#07BA8F',
3435
},
3536
},
3637
});
37-
38-
declare module '@mui/material/styles' {
39-
interface Palette {
40-
userDefined?: PaletteColor;
41-
}
42-
interface PaletteOptions {
43-
userDefined?: PaletteColor;
44-
}
45-
}
46-
47-
/**
48-
* Adding new theme tokens to the Button
49-
* https://mui.com/material-ui/customization/theme-components/#creating-new-component-variants
50-
*/
51-
declare module '@mui/material/Button' {
52-
interface ButtonPropsColorOverrides {
53-
userDefined: true;
54-
}
55-
}

0 commit comments

Comments
 (0)