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