Skip to content

Commit

Permalink
Merge pull request #23 from marmelab/fix_custom_app_doc
Browse files Browse the repository at this point in the history
[RFR] Fix custom app documentation
  • Loading branch information
fzaninotto authored Sep 8, 2016
2 parents 7bebbee + 361a30d commit a8ce290
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/Custom-App.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { Delete } from 'admin-on-rest/lib/mui';

// create a Redux app
const reducer = combineReducers({
admin: adminReducer(['posts, comments, users']),
admin: adminReducer([{ name: 'posts' }, { name: 'comments' }, { name: 'users' }]),
routing: routerReducer,
});
const sagaMiddleware = createSagaMiddleware();
Expand All @@ -52,9 +52,9 @@ const App = () => (
<Router history={history}>
<Route path="/" component={Layout}>
<IndexRoute component={Dashboard} restClient={restClient} />
<CrudRoute key="posts" path="posts" list={PostList} edit={PostEdit} create={PostCreate} remove={Delete} />
<CrudRoute key="comments" path="comments" list={CommentList} edit={CommentEdit} create={CommentCreate} remove={Delete} />
<CrudRoute key="users" path="users" list={UserList} edit={UserEdit} create={UserCreate} remove={Delete} />
<CrudRoute path="posts" list={PostList} edit={PostEdit} create={PostCreate} remove={Delete} />
<CrudRoute path="comments" list={CommentList} edit={CommentEdit} create={CommentCreate} remove={Delete} />
<CrudRoute path="users" list={UserList} edit={UserEdit} create={UserCreate} remove={Delete} />
</Route>
</Router>
</Provider>
Expand Down Expand Up @@ -109,9 +109,9 @@ The `<Layout>` component has the responsibility for displaying the menu. So you
const MyMenu = () => (
<Paper style={{ flex: '0 0 15em', order: -1 }}>
<List>
<ListItem key="posts" containerElement={<Link to={`/posts`} />} primaryText="Posts" leftIcon={<MyPostIcon />} />
<ListItem key="comments" containerElement={<Link to={`/comments`} />} primaryText="Comments" leftIcon={<MyPostIcon />} />
<ListItem key="users" containerElement={<Link to={`/users`} />} primaryText="Users" leftIcon={<MyPostIcon />} />
<ListItem containerElement={<Link to={`/posts`} />} primaryText="Posts" leftIcon={<MyPostIcon />} />
<ListItem containerElement={<Link to={`/comments`} />} primaryText="Comments" leftIcon={<MyPostIcon />} />
<ListItem containerElement={<Link to={`/users`} />} primaryText="Users" leftIcon={<MyPostIcon />} />
)}
</List>
</Paper>
Expand Down
2 changes: 2 additions & 0 deletions src/mui/list/Datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Datagrid.propTypes = {
};

Datagrid.defaultProps = {
data: {},
ids: [],
selectable: true,
};

Expand Down

0 comments on commit a8ce290

Please sign in to comment.