|
1 | 1 | import * as React from 'react'; |
2 | | -import { |
3 | | - PreferencesEditorContextProvider, |
4 | | - I18nContextProvider, |
5 | | - TestMemoryRouter, |
6 | | -} from 'ra-core'; |
| 2 | +import { PreferencesEditorContextProvider } from 'ra-core'; |
7 | 3 | import polyglotI18nProvider from 'ra-i18n-polyglot'; |
8 | 4 | import en from 'ra-language-english'; |
9 | 5 | import fr from 'ra-language-french'; |
| 6 | +import { Box } from '@mui/material'; |
10 | 7 |
|
11 | 8 | import { SimpleListConfigurable } from './SimpleListConfigurable'; |
12 | 9 | import { Inspector, InspectorButton } from '../../preferences'; |
13 | 10 | import { LocalesMenuButton } from '../../button/LocalesMenuButton'; |
14 | | -import { Box } from '@mui/material'; |
| 11 | +import { AdminContext } from '../../AdminContext'; |
15 | 12 |
|
16 | 13 | export default { title: 'ra-ui-materialui/list/SimpleListConfigurable' }; |
17 | 14 |
|
@@ -46,29 +43,27 @@ const translations = { en, fr }; |
46 | 43 | const i18nProvider = polyglotI18nProvider(locale => translations[locale], 'en'); |
47 | 44 |
|
48 | 45 | export const Basic = () => ( |
49 | | - <I18nContextProvider value={i18nProvider}> |
| 46 | + <AdminContext i18nProvider={i18nProvider}> |
50 | 47 | <PreferencesEditorContextProvider> |
51 | | - <TestMemoryRouter> |
52 | | - <Inspector /> |
53 | | - <Box display="flex" justifyContent="flex-end"> |
54 | | - <LocalesMenuButton |
55 | | - languages={[ |
56 | | - { locale: 'en', name: 'English' }, |
57 | | - { locale: 'fr', name: 'Français' }, |
58 | | - ]} |
59 | | - /> |
60 | | - <InspectorButton /> |
61 | | - </Box> |
62 | | - <Box p={2}> |
63 | | - <SimpleListConfigurable |
64 | | - resource="books" |
65 | | - data={data} |
66 | | - primaryText={record => record.title} |
67 | | - secondaryText={record => record.author} |
68 | | - tertiaryText={record => record.year} |
69 | | - /> |
70 | | - </Box> |
71 | | - </TestMemoryRouter> |
| 48 | + <Inspector /> |
| 49 | + <Box display="flex" justifyContent="flex-end"> |
| 50 | + <LocalesMenuButton |
| 51 | + languages={[ |
| 52 | + { locale: 'en', name: 'English' }, |
| 53 | + { locale: 'fr', name: 'Français' }, |
| 54 | + ]} |
| 55 | + /> |
| 56 | + <InspectorButton /> |
| 57 | + </Box> |
| 58 | + <Box p={2}> |
| 59 | + <SimpleListConfigurable |
| 60 | + resource="books" |
| 61 | + data={data} |
| 62 | + primaryText={record => record.title} |
| 63 | + secondaryText={record => record.author} |
| 64 | + tertiaryText={record => record.year} |
| 65 | + /> |
| 66 | + </Box> |
72 | 67 | </PreferencesEditorContextProvider> |
73 | | - </I18nContextProvider> |
| 68 | + </AdminContext> |
74 | 69 | ); |
0 commit comments