File tree 1 file changed +114
-1
lines changed
1 file changed +114
-1
lines changed Original file line number Diff line number Diff line change @@ -2,21 +2,134 @@ import 'mo/workbench/menuBar/style.scss';
2
2
import * as React from 'react' ;
3
3
import { prefixClaName } from 'mo/common/className' ;
4
4
import { IMenuBar } from 'mo/model/workbench/menuBar' ;
5
+ import { Menu } from 'mo/components/menu' ;
6
+ import { DropDown } from 'mo/components/dropdown' ;
7
+ import { Icon } from 'mo/components/icon' ;
5
8
6
9
export interface IMenuBarProps {
7
10
// menuBar: IMenuBar;
8
11
}
9
12
13
+ const initialMenuData = [
14
+ {
15
+ id : 'File' ,
16
+ name : 'File' ,
17
+ data : [
18
+ {
19
+ id : 'New File' ,
20
+ name : 'New File' ,
21
+ } ,
22
+ {
23
+ id : 'OpenFile' ,
24
+ name : 'Open' ,
25
+ } ,
26
+ ] ,
27
+ } ,
28
+ {
29
+ id : 'Edit' ,
30
+ name : 'Edit' ,
31
+ data : [
32
+ {
33
+ id : 'Undo' ,
34
+ name : 'Undo' ,
35
+ } ,
36
+ {
37
+ id : 'Redo' ,
38
+ name : 'Redo' ,
39
+ } ,
40
+ ] ,
41
+ } ,
42
+ {
43
+ id : 'Selection' ,
44
+ name : 'Selection' ,
45
+ data : [
46
+ {
47
+ id : 'SelectAll' ,
48
+ name : 'Select All' ,
49
+ } ,
50
+ {
51
+ id : 'CopyLineUp' ,
52
+ name : 'Copy Line Up' ,
53
+ } ,
54
+ ] ,
55
+ } ,
56
+ {
57
+ id : 'View' ,
58
+ name : 'View' ,
59
+ data : [
60
+ {
61
+ id : 'Command Palette' ,
62
+ name : 'Command Palette' ,
63
+ } ,
64
+ {
65
+ id : 'OpenView' ,
66
+ name : 'Open View' ,
67
+ } ,
68
+ {
69
+ id : 'Appearance' ,
70
+ name : 'Appearance' ,
71
+ data : [
72
+ {
73
+ icon : 'check' ,
74
+ id : 'ShowMenuBar' ,
75
+ name : 'Show Menu Bar' ,
76
+ } ,
77
+ {
78
+ icon : 'check' ,
79
+ id : 'ShowSideBar' ,
80
+ name : 'Show Side Bar' ,
81
+ } ,
82
+ {
83
+ icon : 'check' ,
84
+ id : 'ShowStatusBar' ,
85
+ name : 'Show Status Bar' ,
86
+ } ,
87
+ {
88
+ icon : 'check' ,
89
+ id : 'ShowActivityBar' ,
90
+ name : 'Show Activity Bar' ,
91
+ } ,
92
+ ] ,
93
+ } ,
94
+ ] ,
95
+ } ,
96
+ {
97
+ id : 'Run' ,
98
+ name : 'Run' ,
99
+ data : [
100
+ {
101
+ id : 'RunTask' ,
102
+ name : 'Run Task' ,
103
+ } ,
104
+ ] ,
105
+ } ,
106
+ {
107
+ id : 'Help' ,
108
+ name : 'Help' ,
109
+ data : [
110
+ {
111
+ id : 'About' ,
112
+ name : 'About' ,
113
+ } ,
114
+ ] ,
115
+ } ,
116
+ ] ;
117
+
10
118
function MenuBar ( props : IMenuBar ) {
11
119
const menuBar = props ;
12
120
const click = function ( e ) {
13
121
menuBar . onClick ( e , {
14
122
name : 'test' ,
15
123
} ) ;
16
124
} ;
125
+ const menu = (
126
+ < Menu onClick = { click } style = { { width : 200 } } data = { initialMenuData } />
127
+ ) ;
17
128
return (
18
129
< div className = { prefixClaName ( 'menuBar' ) } >
19
- < a className = "menu-action codicon codicon-menu" onClick = { click } > </ a >
130
+ < DropDown className = "menu-action" placement = "right" overlay = { menu } >
131
+ < Icon type = "menu" />
132
+ </ DropDown >
20
133
</ div >
21
134
) ;
22
135
}
You can’t perform that action at this time.
0 commit comments