Skip to content

Commit 8397f79

Browse files
Use the shared MoreMenuButton and ButtonGroup seam (#1266)
Upgrade to @microbit/ui@0.1.0-alpha.30 @microbit/ui's ButtonGroup now draws the seam between attached buttons itself: a 1px hairline in the variant's border colour, or a gap where the variant has no border to lend. That is what the split buttons here already hand-wrote — a `borderRight` and a `borderLeft` either side of the group's -1px overlap — so the save and send buttons lose their local borders, and MoreMenuButton goes up to the shared package with them. The zoom and undo/redo pills drop their gray.10 dividers for the same reason. `neutral` has no border, so their seam is now a gap showing the page through rather than a near-white line drawn over the grey; on this surface that is the same pixels. No visual change intended. See microbit-foundation/ui#22
1 parent ea0f420 commit 8397f79

7 files changed

Lines changed: 14 additions & 60 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@codemirror/view": "^6.26.3",
2222
"@microbit/microbit-connection": "^1.0.0",
2323
"@microbit/microbit-fs": "^0.10.0",
24-
"@microbit/ui": "0.1.0-alpha.29",
24+
"@microbit/ui": "0.1.0-alpha.30",
2525
"@microbit/ui-patterns": "0.1.0-alpha.3",
2626
"@sanity/block-content-to-react": "^3.0.0",
2727
"@sanity/image-url": "^1.0.1",

src/editor/UndoRedoControls.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const UndoRedoControls = ({ css: cssProp }: UndoRedoControlsProps) => {
4040
</IconButton>
4141
<IconButton
4242
variant="neutral"
43-
css={{ borderLeft: "1px solid", borderLeftColor: "gray.10" }}
4443
aria-label={intl.formatMessage({ id: "redo" })}
4544
onPress={actions?.redo}
4645
isDisabled={editorInfo.redo ? false : true}

src/editor/ZoomControls.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const ZoomControls = ({ size, css: cssProp }: ZoomControlsProps) => {
5353
<RiZoomOutLine />
5454
</IconButton>
5555
<IconButton
56-
css={{ borderLeft: "1px solid", borderLeftColor: "gray.10" }}
5756
size={size}
5857
variant="neutral"
5958
aria-label={intl.formatMessage({ id: "zoom-in-action" })}

src/project/MoreMenuButton.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/project/SaveMenuButton.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
*
44
* SPDX-License-Identifier: MIT
55
*/
6-
import { ButtonGroup, MenuItem, MenuList, MenuTrigger } from "@microbit/ui";
6+
import {
7+
ButtonGroup,
8+
MenuItem,
9+
MenuList,
10+
MenuTrigger,
11+
MoreMenuButton,
12+
} from "@microbit/ui";
713
import { RiDownload2Line } from "react-icons/ri";
814
import { FormattedMessage, useIntl } from "react-intl";
915
import { HStack } from "styled-system/jsx";
1016
import SaveButton from "./SaveButton";
11-
import MoreMenuButton from "./MoreMenuButton";
1217
import { useProjectActions } from "./project-hooks";
1318
import { useRef } from "react";
1419

@@ -29,11 +34,7 @@ const SaveMenuButton = ({ size }: SaveMenuButtonProps) => {
2934
return (
3035
<HStack>
3136
<ButtonGroup isAttached>
32-
<SaveButton
33-
mode="button"
34-
size={size}
35-
css={{ borderRight: "1px solid" }}
36-
/>
37+
<SaveButton mode="button" size={size} />
3738
<MenuTrigger>
3839
<MoreMenuButton
3940
ref={menuButtonRef}

src/project/SendButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
MenuItem,
1010
MenuList,
1111
MenuTrigger,
12+
MoreMenuButton,
1213
Tooltip,
1314
} from "@microbit/ui";
1415
import React, { ForwardedRef, useCallback, useRef } from "react";
@@ -17,7 +18,6 @@ import { FormattedMessage, useIntl } from "react-intl";
1718
import { HStack } from "styled-system/jsx";
1819
import { ConnectionStatus } from "@microbit/microbit-connection";
1920
import { useConnectionStatus } from "../device/device-hooks";
20-
import MoreMenuButton from "./MoreMenuButton";
2121
import { useProjectActions } from "./project-hooks";
2222
import { useHotkeys } from "react-hotkeys-hook";
2323
import {

0 commit comments

Comments
 (0)