Skip to content

Commit

Permalink
Merge pull request #9441 from marmelab/adapt-stories-theme
Browse files Browse the repository at this point in the history
adapt stories theme
  • Loading branch information
slax57 committed Nov 14, 2023
2 parents 277fb01 + 40d0f4e commit 6595ac4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Admin } from 'react-admin';
import { Resource } from 'ra-core';
import { Resource, memoryStore } from 'ra-core';
import fakeRestDataProvider from 'ra-data-fakerest';
import { createMemoryHistory } from 'history';

Expand Down Expand Up @@ -98,6 +98,7 @@ const BookList = () => (

export const Basic = () => (
<Admin
store={memoryStore()}
dataProvider={dataProvider}
history={history}
darkTheme={{ palette: { mode: 'dark' } }}
Expand All @@ -115,7 +116,12 @@ const MyAppBar = () => (
const MyLayout = props => <Layout {...props} appBar={MyAppBar} />;

export const Legacy = () => (
<Admin dataProvider={dataProvider} history={history} layout={MyLayout}>
<Admin
store={memoryStore()}
dataProvider={dataProvider}
history={history}
layout={MyLayout}
>
<Resource name="books" list={BookList} />
</Admin>
);
4 changes: 3 additions & 1 deletion packages/ra-ui-materialui/src/layout/Menu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Resource, CustomRoutes, testDataProvider } from 'ra-core';
import { Resource, CustomRoutes, testDataProvider, memoryStore } from 'ra-core';
import { defaultTheme, Admin, useSidebarState } from 'react-admin';
import {
Typography,
Expand Down Expand Up @@ -45,6 +45,7 @@ export const Default = () => {

return (
<Admin
store={memoryStore()}
dataProvider={testDataProvider()}
layout={DefaultLayout}
darkTheme={darkTheme}
Expand All @@ -66,6 +67,7 @@ export const Dense = () => {

return (
<Admin
store={memoryStore()}
dataProvider={testDataProvider()}
layout={LayoutDense}
darkTheme={darkTheme}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
DateField,
FilterList,
FilterListItem,
memoryStore,
} from 'react-admin';
import { Card, CardContent, styled } from '@mui/material';
import BusinessIcon from '@mui/icons-material/Business';
Expand Down Expand Up @@ -202,6 +203,7 @@ const darkTheme: RaThemeOptions = {

export const WithThemeAndLocale = () => (
<Admin
store={memoryStore()}
history={createMemoryHistory()}
i18nProvider={i18nProvider}
dataProvider={dataProvider}
Expand Down

0 comments on commit 6595ac4

Please sign in to comment.