Commit dadc4f1
feat: allow MenuBar to be hidden
The MenuBar is quite specific to the canonical version of the online Scratch
editor [1]. In RaspberryPiFoundation projects we want to make use of the
scratch-gui package without displaying the MenuBar.
The MenuBar can be hidden by passing in the `menuBarHidden` prop.
Since the height of the menu bar is hard-coded as a CSS variable, I've
had to override the height calculation for the body wrapper when the
menu bar is not visible. Ideally the height of the menu bar wouldn't be
hard-coded and this wouldn't be necessary.
We were unable to find an existing unit test for the Gui component and so we
have not added any test coverage around the new `menuBarHidden` prop.
[1]: https://scratch.mit.edu/projects/editor
Co-authored-by: James Mead <james.mead@gofreerange.com>1 parent b0602f3 commit dadc4f1
2 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
| |||
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
258 | | - | |
| 262 | + | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| |||
290 | 294 | | |
291 | 295 | | |
292 | 296 | | |
293 | | - | |
294 | | - | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| |||
465 | 469 | | |
466 | 470 | | |
467 | 471 | | |
| 472 | + | |
468 | 473 | | |
469 | 474 | | |
470 | 475 | | |
| |||
527 | 532 | | |
528 | 533 | | |
529 | 534 | | |
| 535 | + | |
530 | 536 | | |
531 | 537 | | |
532 | 538 | | |
| |||
0 commit comments