forked from findyourmagic/dber
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext_menu.js
More file actions
44 lines (43 loc) · 1.67 KB
/
context_menu.js
File metadata and controls
44 lines (43 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Space } from '@arco-design/web-react';
import { Menu, Item, Separator, theme } from 'react-contexify';
import 'react-contexify/dist/ReactContexify.css';
export default function ContextMenu(props) {
return (
<Menu id={props.menuId} animation="fade" theme={props.theme === 'dark' ? theme.dark : theme.light}>
<Item
onClick={({ triggerEvent }) => {
props.addTable({ x: triggerEvent.clientX - 40, y: triggerEvent.clientY - 100 });
}}
style={{ justifyContent: 'center' }}
>
Add New Table
<Space size={4}>
<div className="arco-home-key">⌘</div>
<div className="arco-home-key">N</div>
</Space>
</Item>
<Item onClick={() => props.setImportType('MySQL')}>
Import Table
<Space size={4}>
<div className="arco-home-key">⌘</div>
<div className="arco-home-key">I</div>
</Space>
</Item>
<Separator />
<Item onClick={() => props.saveGraph()}>
Save
<Space size={4}>
<div className="arco-home-key">⌘</div>
<div className="arco-home-key">S</div>
</Space>
</Item>
<Item onClick={() => props.handlerExport()}>
Export Database
<Space size={4}>
<div className="arco-home-key">⌘</div>
<div className="arco-home-key">E</div>
</Space>
</Item>
</Menu>
);
}