Skip to content

Commit 03f9825

Browse files
authored
Merge pull request #9264 from marmelab/fix-demo-store-overrides
[Demo] Fix preferences are shared between demos
2 parents 530f01f + 5ae89e6 commit 03f9825

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

examples/crm/src/App.tsx

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
import * as React from 'react';
2-
import { Admin, Resource, ListGuesser, defaultTheme } from 'react-admin';
3-
import { dataProvider } from './dataProvider';
4-
import { authProvider } from './authProvider';
1+
import {
2+
Admin,
3+
ListGuesser,
4+
Resource,
5+
defaultTheme,
6+
localStorageStore,
7+
} from 'react-admin';
8+
59
import Layout from './Layout';
6-
import contacts from './contacts';
10+
import { authProvider } from './authProvider';
711
import companies from './companies';
8-
import deals from './deals';
12+
import contacts from './contacts';
913
import { Dashboard } from './dashboard/Dashboard';
14+
import { dataProvider } from './dataProvider';
15+
import deals from './deals';
1016

1117
const App = () => (
1218
<Admin
1319
dataProvider={dataProvider}
1420
authProvider={authProvider}
21+
store={localStorageStore(undefined, 'CRM')}
1522
layout={Layout}
1623
dashboard={Dashboard}
1724
theme={{

examples/demo/src/App.tsx

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
import * as React from 'react';
2-
import { Admin, CustomRoutes, Resource } from 'react-admin';
31
import polyglotI18nProvider from 'ra-i18n-polyglot';
2+
import { Admin, CustomRoutes, Resource, localStorageStore } from 'react-admin';
43
import { Route } from 'react-router';
54

65
import authProvider from './authProvider';
7-
import { Login, Layout } from './layout';
6+
import categories from './categories';
87
import { Dashboard } from './dashboard';
8+
import dataProviderFactory from './dataProvider';
99
import englishMessages from './i18n/en';
10-
import { lightTheme, darkTheme } from './layout/themes';
11-
12-
import visitors from './visitors';
10+
import invoices from './invoices';
11+
import { Layout, Login } from './layout';
12+
import { darkTheme, lightTheme } from './layout/themes';
1313
import orders from './orders';
1414
import products from './products';
15-
import invoices from './invoices';
16-
import categories from './categories';
1715
import reviews from './reviews';
18-
import dataProviderFactory from './dataProvider';
1916
import Segments from './segments/Segments';
17+
import visitors from './visitors';
2018

2119
const i18nProvider = polyglotI18nProvider(
2220
locale => {
@@ -40,6 +38,7 @@ const App = () => (
4038
dataProvider={dataProviderFactory(
4139
process.env.REACT_APP_DATA_PROVIDER || ''
4240
)}
41+
store={localStorageStore(undefined, 'ECommerce')}
4342
authProvider={authProvider}
4443
dashboard={Dashboard}
4544
loginPage={Login}

0 commit comments

Comments
 (0)