Skip to content

Commit 9ac1962

Browse files
authored
fix(color theme): optimize the Panel, actionBar (#445)
* refactor: rename tag a to div * fix(color theme): optimize the Panel, actionBar * test: update the Menu snapshot
1 parent 76ad9b3 commit 9ac1962

File tree

6 files changed

+69
-53
lines changed

6 files changed

+69
-53
lines changed

src/components/menu/__tests__/__snapshots__/menu.test.tsx.snap

+42-42
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
1818
data-submenu={true}
1919
id="File"
2020
>
21-
<a
21+
<div
2222
className="mo-menu__content"
2323
>
2424
<span
@@ -29,7 +29,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
2929
<span
3030
className="mo-menu__indicator codicon codicon-chevron-right"
3131
/>
32-
</a>
32+
</div>
3333
<ul
3434
className="mo-menu mo-menu--vertical mo-sub-menu"
3535
id="File"
@@ -45,7 +45,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
4545
id="New File"
4646
onClick={[Function]}
4747
>
48-
<a
48+
<div
4949
className="mo-menu__content"
5050
>
5151
<span
@@ -54,14 +54,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
5454
>
5555
New File
5656
</span>
57-
</a>
57+
</div>
5858
</li>
5959
<li
6060
className="mo-menu__item"
6161
id="OpenFile"
6262
onClick={[Function]}
6363
>
64-
<a
64+
<div
6565
className="mo-menu__content"
6666
>
6767
<span
@@ -70,7 +70,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
7070
>
7171
Open
7272
</span>
73-
</a>
73+
</div>
7474
</li>
7575
</ul>
7676
</li>
@@ -79,7 +79,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
7979
data-submenu={true}
8080
id="Edit"
8181
>
82-
<a
82+
<div
8383
className="mo-menu__content"
8484
>
8585
<span
@@ -90,7 +90,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
9090
<span
9191
className="mo-menu__indicator codicon codicon-chevron-right"
9292
/>
93-
</a>
93+
</div>
9494
<ul
9595
className="mo-menu mo-menu--vertical mo-sub-menu"
9696
id="Edit"
@@ -106,7 +106,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
106106
id="Undo"
107107
onClick={[Function]}
108108
>
109-
<a
109+
<div
110110
className="mo-menu__content"
111111
>
112112
<span
@@ -115,14 +115,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
115115
>
116116
Undo
117117
</span>
118-
</a>
118+
</div>
119119
</li>
120120
<li
121121
className="mo-menu__item"
122122
id="Redo"
123123
onClick={[Function]}
124124
>
125-
<a
125+
<div
126126
className="mo-menu__content"
127127
>
128128
<span
@@ -131,7 +131,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
131131
>
132132
Redo
133133
</span>
134-
</a>
134+
</div>
135135
</li>
136136
</ul>
137137
</li>
@@ -140,7 +140,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
140140
data-submenu={true}
141141
id="Selection"
142142
>
143-
<a
143+
<div
144144
className="mo-menu__content"
145145
>
146146
<span
@@ -151,7 +151,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
151151
<span
152152
className="mo-menu__indicator codicon codicon-chevron-right"
153153
/>
154-
</a>
154+
</div>
155155
<ul
156156
className="mo-menu mo-menu--vertical mo-sub-menu"
157157
id="Selection"
@@ -167,7 +167,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
167167
id="SelectAll"
168168
onClick={[Function]}
169169
>
170-
<a
170+
<div
171171
className="mo-menu__content"
172172
>
173173
<span
@@ -176,14 +176,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
176176
>
177177
Select All
178178
</span>
179-
</a>
179+
</div>
180180
</li>
181181
<li
182182
className="mo-menu__item"
183183
id="CopyLineUp"
184184
onClick={[Function]}
185185
>
186-
<a
186+
<div
187187
className="mo-menu__content"
188188
>
189189
<span
@@ -192,7 +192,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
192192
>
193193
Copy Line Up
194194
</span>
195-
</a>
195+
</div>
196196
</li>
197197
</ul>
198198
</li>
@@ -201,7 +201,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
201201
data-submenu={true}
202202
id="View"
203203
>
204-
<a
204+
<div
205205
className="mo-menu__content"
206206
>
207207
<span
@@ -212,7 +212,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
212212
<span
213213
className="mo-menu__indicator codicon codicon-chevron-right"
214214
/>
215-
</a>
215+
</div>
216216
<ul
217217
className="mo-menu mo-menu--vertical mo-sub-menu"
218218
id="View"
@@ -228,7 +228,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
228228
id="Command Palette"
229229
onClick={[Function]}
230230
>
231-
<a
231+
<div
232232
className="mo-menu__content"
233233
>
234234
<span
@@ -237,14 +237,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
237237
>
238238
Command Palette
239239
</span>
240-
</a>
240+
</div>
241241
</li>
242242
<li
243243
className="mo-menu__item"
244244
id="OpenView"
245245
onClick={[Function]}
246246
>
247-
<a
247+
<div
248248
className="mo-menu__content"
249249
>
250250
<span
@@ -253,14 +253,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
253253
>
254254
Open View
255255
</span>
256-
</a>
256+
</div>
257257
</li>
258258
<li
259259
className="mo-menu__item"
260260
data-submenu={true}
261261
id="Appearance"
262262
>
263-
<a
263+
<div
264264
className="mo-menu__content"
265265
>
266266
<span
@@ -271,7 +271,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
271271
<span
272272
className="mo-menu__indicator codicon codicon-chevron-right"
273273
/>
274-
</a>
274+
</div>
275275
<ul
276276
className="mo-menu mo-menu--vertical mo-sub-menu"
277277
id="Appearance"
@@ -287,7 +287,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
287287
id="ShowMenuBar"
288288
onClick={[Function]}
289289
>
290-
<a
290+
<div
291291
className="mo-menu__content"
292292
>
293293
<span
@@ -299,14 +299,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
299299
>
300300
Show Menu Bar
301301
</span>
302-
</a>
302+
</div>
303303
</li>
304304
<li
305305
className="mo-menu__item"
306306
id="ShowSideBar"
307307
onClick={[Function]}
308308
>
309-
<a
309+
<div
310310
className="mo-menu__content"
311311
>
312312
<span
@@ -318,14 +318,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
318318
>
319319
Show Side Bar
320320
</span>
321-
</a>
321+
</div>
322322
</li>
323323
<li
324324
className="mo-menu__item"
325325
id="ShowStatusBar"
326326
onClick={[Function]}
327327
>
328-
<a
328+
<div
329329
className="mo-menu__content"
330330
>
331331
<span
@@ -337,14 +337,14 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
337337
>
338338
Show Status Bar
339339
</span>
340-
</a>
340+
</div>
341341
</li>
342342
<li
343343
className="mo-menu__item"
344344
id="ShowActivityBar"
345345
onClick={[Function]}
346346
>
347-
<a
347+
<div
348348
className="mo-menu__content"
349349
>
350350
<span
@@ -356,7 +356,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
356356
>
357357
Show Activity Bar
358358
</span>
359-
</a>
359+
</div>
360360
</li>
361361
</ul>
362362
</li>
@@ -367,7 +367,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
367367
data-submenu={true}
368368
id="Run"
369369
>
370-
<a
370+
<div
371371
className="mo-menu__content"
372372
>
373373
<span
@@ -378,7 +378,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
378378
<span
379379
className="mo-menu__indicator codicon codicon-chevron-right"
380380
/>
381-
</a>
381+
</div>
382382
<ul
383383
className="mo-menu mo-menu--vertical mo-sub-menu"
384384
id="Run"
@@ -394,7 +394,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
394394
id="RunTask"
395395
onClick={[Function]}
396396
>
397-
<a
397+
<div
398398
className="mo-menu__content"
399399
>
400400
<span
@@ -403,7 +403,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
403403
>
404404
Run Task
405405
</span>
406-
</a>
406+
</div>
407407
</li>
408408
</ul>
409409
</li>
@@ -412,7 +412,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
412412
data-submenu={true}
413413
id="Help"
414414
>
415-
<a
415+
<div
416416
className="mo-menu__content"
417417
>
418418
<span
@@ -423,7 +423,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
423423
<span
424424
className="mo-menu__indicator codicon codicon-chevron-right"
425425
/>
426-
</a>
426+
</div>
427427
<ul
428428
className="mo-menu mo-menu--vertical mo-sub-menu"
429429
id="Help"
@@ -439,7 +439,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
439439
id="About"
440440
onClick={[Function]}
441441
>
442-
<a
442+
<div
443443
className="mo-menu__content"
444444
>
445445
<span
@@ -448,7 +448,7 @@ exports[`Test the Menu Component Match the List snapshot 1`] = `
448448
>
449449
About
450450
</span>
451-
</a>
451+
</div>
452452
</li>
453453
</ul>
454454
</li>

src/components/menu/menuItem.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function MenuItem(props: React.PropsWithChildren<IMenuItemProps>) {
6969
{...events}
7070
{...custom}
7171
>
72-
<a className={menuContentClassName}>
72+
<div className={menuContentClassName}>
7373
<Icon type={icon} className={checkClassName} />
7474
<span
7575
className={labelClassName}
@@ -80,7 +80,7 @@ export function MenuItem(props: React.PropsWithChildren<IMenuItemProps>) {
8080
{keybinding ? (
8181
<span className={keybindingClassName}>{keybinding}</span>
8282
) : null}
83-
</a>
83+
</div>
8484
</li>
8585
);
8686
}

0 commit comments

Comments
 (0)