@@ -6,6 +6,8 @@ import { Box } from '@mui/material';
6
6
import { DatagridConfigurable } from './DatagridConfigurable' ;
7
7
import { Inspector , InspectorButton } from '../../preferences' ;
8
8
import { TextField } from '../../field' ;
9
+ import { EditButton } from '../../button' ;
10
+ import { createTheme , ThemeProvider } from '@mui/material/styles' ;
9
11
10
12
export default { title : 'ra-ui-materialui/list/DatagridConfigurable' } ;
11
13
@@ -39,28 +41,33 @@ const data = [
39
41
const AuthorField = ( ) => < TextField source = "author" /> ;
40
42
AuthorField . defaultProps = { label : 'Author' } ;
41
43
44
+ const theme = createTheme ( ) ;
45
+
42
46
export const Basic = ( ) => (
43
- < PreferencesEditorContextProvider >
44
- < MemoryRouter >
45
- < Inspector />
46
- < Box display = "flex" justifyContent = "flex-end" >
47
- < InspectorButton />
48
- </ Box >
49
- < Box p = { 2 } >
50
- < DatagridConfigurable
51
- resource = "books1"
52
- data = { data }
53
- sort = { { field : 'title' , order : 'ASC' } }
54
- bulkActionButtons = { false }
55
- >
56
- < TextField source = "id" />
57
- < TextField source = "title" label = "Original title" />
58
- < TextField source = "author" />
59
- < TextField source = "year" />
60
- </ DatagridConfigurable >
61
- </ Box >
62
- </ MemoryRouter >
63
- </ PreferencesEditorContextProvider >
47
+ < ThemeProvider theme = { theme } >
48
+ < PreferencesEditorContextProvider >
49
+ < MemoryRouter >
50
+ < Inspector />
51
+ < Box display = "flex" justifyContent = "flex-end" >
52
+ < InspectorButton />
53
+ </ Box >
54
+ < Box p = { 2 } >
55
+ < DatagridConfigurable
56
+ resource = "books1"
57
+ data = { data }
58
+ sort = { { field : 'title' , order : 'ASC' } }
59
+ bulkActionButtons = { false }
60
+ >
61
+ < TextField source = "id" />
62
+ < TextField source = "title" label = "Original title" />
63
+ < TextField source = "author" />
64
+ < TextField source = "year" />
65
+ < EditButton />
66
+ </ DatagridConfigurable >
67
+ </ Box >
68
+ </ MemoryRouter >
69
+ </ PreferencesEditorContextProvider >
70
+ </ ThemeProvider >
64
71
) ;
65
72
66
73
export const Omit = ( ) => (
0 commit comments