diff --git a/src/button/ReactionToggleButton.module.css b/src/button/ReactionToggleButton.module.css
index c6b65de5..1919dd18 100644
--- a/src/button/ReactionToggleButton.module.css
+++ b/src/button/ReactionToggleButton.module.css
@@ -14,9 +14,11 @@
top: 82vh !important;
}
-.reactionPopupMenuModal > div > div {
- padding-inline: var(--cpd-space-6x) !important;
- padding-block: var(--cpd-space-6x) var(--cpd-space-8x) !important;
+@media not ((hover: none) or (pointer: coarse)) {
+ .reactionPopupMenuModal > div > div {
+ padding-inline: var(--cpd-space-6x) !important;
+ padding-block: var(--cpd-space-6x) var(--cpd-space-8x) !important;
+ }
}
.reactionPopupMenu menu {
@@ -24,6 +26,7 @@
padding: 0;
display: flex;
flex-wrap: wrap;
+ gap: var(--cpd-separator-spacing);
}
.reactionPopupMenu section {
@@ -34,19 +37,14 @@
.reactionPopupMenuItem {
list-style: none;
- margin-left: var(--cpd-separator-spacing);
-}
-
-.reactionPopupMenuItem:first-child {
- margin-left: 0;
}
.reactionButton {
padding: 1em;
- font-size: 2em;
- width: 2em;
- height: 2em;
- border-radius: 2em;
+ font-size: 1.8em;
+ width: 1.8em;
+ height: 1.8em;
+ border-radius: 1.8em;
}
.verticalSeperator {
diff --git a/src/button/ReactionToggleButton.test.tsx b/src/button/ReactionToggleButton.test.tsx
index 61e2e217..0ab84f7f 100644
--- a/src/button/ReactionToggleButton.test.tsx
+++ b/src/button/ReactionToggleButton.test.tsx
@@ -5,7 +5,8 @@ SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
-import { act, fireEvent, render } from "@testing-library/react";
+import { fireEvent, render } from "@testing-library/react";
+import { act } from "react";
import { expect, test } from "vitest";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import { TooltipProvider } from "@vector-im/compound-web";
@@ -59,14 +60,14 @@ test("Can open menu", () => {
test("Can raise hand", () => {
const room = new MockRoom(memberUserIdAlice);
const rtcSession = new MockRTCSession(room, membership);
- const { getByRole, getByText, container } = render(
+ const { getByRole, getByLabelText, container } = render(
,
);
act(() => {
getByRole("button").click();
});
act(() => {
- getByText("🖐️").click();
+ getByLabelText("Toggle hand raised").click();
});
expect(room.testSentEvents).toEqual([
[
@@ -87,7 +88,7 @@ test("Can raise hand", () => {
test("Can lower hand", () => {
const room = new MockRoom(memberUserIdAlice);
const rtcSession = new MockRTCSession(room, membership);
- const { getByRole, getByText, container } = render(
+ const { getByRole, getByLabelText, container } = render(
,
);
const reactionEvent = room.testSendHandRaise(memberEventAlice, membership);
@@ -95,7 +96,7 @@ test("Can lower hand", () => {
getByRole("button").click();
});
act(() => {
- getByText("🖐️").click();
+ getByLabelText("Toggle hand raised").click();
});
expect(room.testRedactedEvents).toEqual([[undefined, reactionEvent]]);
expect(container).toMatchSnapshot();
diff --git a/src/button/ReactionToggleButton.tsx b/src/button/ReactionToggleButton.tsx
index 6983dbd6..49b07879 100644
--- a/src/button/ReactionToggleButton.tsx
+++ b/src/button/ReactionToggleButton.tsx
@@ -126,12 +126,10 @@ export function ReactionPopupMenu({
kind={isHandRaised ? "primary" : "secondary"}
aria-pressed={isHandRaised}
aria-label="Toggle hand raised"
- className={styles.reactionButton}
- key="raise-hand"
onClick={() => toggleRaisedHand()}
- >
- 🖐️
-
+ iconOnly
+ Icon={RaisedHandSolidIcon}
+ />
@@ -177,21 +175,23 @@ export function ReactionPopupMenu({
))}
- {!isSearching ? (
-
-
- setIsSearching(true)}
- />
-
-
- ) : null}
+ {!isSearching ? (
+
+
+
+ setIsSearching(true)}
+ />
+
+
+
+ ) : null}
);
}
@@ -302,7 +302,7 @@ export function ReactionToggleButton({
setShowReactionsMenu((show) => !show)}
- raised={isHandRaised || showReactionsMenu}
+ raised={isHandRaised}
open={showReactionsMenu}
/>
+
@@ -102,7 +105,7 @@ exports[`Can open menu 1`] = `
aria-disabled="false"
aria-expanded="true"
aria-labelledby=":r0:"
- class="_button_i91xf_17 raisedButton _has-icon_i91xf_66 _icon-only_i91xf_59"
+ class="_button_i91xf_17 _has-icon_i91xf_66 _icon-only_i91xf_59"
data-kind="primary"
data-size="lg"
role="button"
@@ -117,7 +120,10 @@ exports[`Can open menu 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
+
@@ -133,7 +139,7 @@ exports[`Can raise hand 1`] = `
aria-disabled="true"
aria-expanded="true"
aria-labelledby=":r1p:"
- class="_button_i91xf_17 raisedButton _has-icon_i91xf_66 _icon-only_i91xf_59"
+ class="_button_i91xf_17 _has-icon_i91xf_66 _icon-only_i91xf_59"
data-kind="primary"
data-size="lg"
role="button"
@@ -148,7 +154,10 @@ exports[`Can raise hand 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
+
@@ -164,7 +173,7 @@ exports[`Can search for and send emoji 1`] = `
aria-disabled="false"
aria-expanded="true"
aria-labelledby=":r74:"
- class="_button_i91xf_17 raisedButton _has-icon_i91xf_66 _icon-only_i91xf_59"
+ class="_button_i91xf_17 _has-icon_i91xf_66 _icon-only_i91xf_59"
data-kind="primary"
data-size="lg"
role="button"
@@ -179,7 +188,10 @@ exports[`Can search for and send emoji 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
+
@@ -195,7 +207,7 @@ exports[`Can search for and send emoji with the keyboard 1`] = `
aria-disabled="false"
aria-expanded="true"
aria-labelledby=":ra3:"
- class="_button_i91xf_17 raisedButton _has-icon_i91xf_66 _icon-only_i91xf_59"
+ class="_button_i91xf_17 _has-icon_i91xf_66 _icon-only_i91xf_59"
data-kind="primary"
data-size="lg"
role="button"
@@ -210,7 +222,10 @@ exports[`Can search for and send emoji with the keyboard 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
+