Skip to content

Commit 8f81a7d

Browse files
committed
Add shortcuts to simple example
1 parent 1a66cc1 commit 8f81a7d

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

examples/simple/src/Layout.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import * as React from 'react';
22
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
3-
import { AppBar, Layout, InspectorButton, TitlePortal } from 'react-admin';
3+
import {
4+
AppBar,
5+
Layout,
6+
Menu,
7+
InspectorButton,
8+
TitlePortal,
9+
} from 'react-admin';
410
import '../assets/app.css';
511

612
const MyAppBar = () => (
@@ -10,9 +16,20 @@ const MyAppBar = () => (
1016
</AppBar>
1117
);
1218

19+
const MyMenu = () => (
20+
<Menu>
21+
<Menu.ResourceItem name="posts" keyboardShortcut="g>p" />
22+
<Menu.ResourceItem name="comments" keyboardShortcut="g>c" />
23+
<Menu.ResourceItem name="tags" keyboardShortcut="g>t" />
24+
<Menu.ResourceItem name="users" keyboardShortcut="g>u" />
25+
</Menu>
26+
);
27+
1328
export default ({ children }) => (
1429
<>
15-
<Layout appBar={MyAppBar}>{children}</Layout>
30+
<Layout appBar={MyAppBar} menu={MyMenu}>
31+
{children}
32+
</Layout>
1633
<ReactQueryDevtools
1734
initialIsOpen={false}
1835
buttonPosition="bottom-left"

0 commit comments

Comments
 (0)