Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storybook] Fix stories with ToggleThemeButton should not persist theme in localStorage #9441

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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