Skip to content

Commit

Permalink
Fix non-Admin snippet in custom app documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto authored and mikaoelitiana committed Nov 22, 2018
1 parent dd52d20 commit 9f65043
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions docs/CustomApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,18 @@ const App = () => (
- <Resource name="comments" list={CommentList} edit={CommentEdit} create={CommentCreate} />
- <Resource name="users" list={UserList} edit={UserEdit} create={UserCreate} />
+ <TranslationProvider>
+ <ConnectedRouter history={history}>
+ <MuiThemeProvider>
+ <Resource name="posts" context="registration" />
+ <Resource name="comments" context="registration" />
+ <Resource name="users" context="registration" />
+ <MuiThemeProvider>
+ <AppBar position="static" color="default">
+ <Toolbar>
+ <Typography variant="title" color="inherit">
+ My admin
+ </Typography>
+ </Toolbar>
+ </AppBar>
+ <AppBar position="static" color="default">
+ <Toolbar>
+ <Typography variant="title" color="inherit">
+ My admin
+ </Typography>
+ </Toolbar>
+ </AppBar>
+ <ConnectedRouter history={history}>
+ <Switch>
+ <Route exact path="/" component={Dashboard} />
+ <Route exact path="/posts" hasCreate render={(routeProps) => <PostList resource="posts" {...routeProps} />} />
Expand All @@ -226,8 +226,8 @@ const App = () => (
+ <Route exact path="/users/create" render={(routeProps) => <UsersCreate resource="users" {...routeProps} />} />
+ <Route exact path="/users/:id" render={(routeProps) => <UsersEdit resource="users" {...routeProps} />} />
+ </Switch>
+ </MuiThemeProvider>
+ </ConnectedRouter>
+ </ConnectedRouter>
+ </MuiThemeProvider>
+ </TranslationProvider>
- </Admin>
</Provider>
Expand All @@ -239,6 +239,7 @@ const App = () => (
+ authProvider: PropTypes.func,
+ },
+ () => ({ authProvider })
+)(App);
```

Note that this example still uses `<Resource>`, because this component lazily initializes the store for the resource data.
Expand Down

0 comments on commit 9f65043

Please sign in to comment.