diff --git a/matrixgw_frontend/src/widgets/messages/RoomMessagesList.tsx b/matrixgw_frontend/src/widgets/messages/RoomMessagesList.tsx index a06349c..7b7d03c 100644 --- a/matrixgw_frontend/src/widgets/messages/RoomMessagesList.tsx +++ b/matrixgw_frontend/src/widgets/messages/RoomMessagesList.tsx @@ -12,6 +12,7 @@ import { DialogContentText, DialogTitle, TextField, + Tooltip, Typography, useTheme, } from "@mui/material"; @@ -150,7 +151,7 @@ function RoomMessage(p: { const handleToggleReaction = async ( key: string, - reaction: MessageReaction + reaction: MessageReaction | undefined ) => { try { if (!reaction) @@ -268,42 +269,58 @@ function RoomMessage(p: { {/* Reaction */} {[...p.message.reactions.keys()].map((r) => { - const userReaction = p.message.reactions - .get(r)! - .find((r) => r.account === user.info.matrix_user_id); + const reactions = p.message.reactions.get(r)!; + const userReaction = reactions.find( + (r) => r.account === user.info.matrix_user_id + ); return ( - handleToggleReaction(r, userReaction) }, - label: { style: { height: "2em" } }, - }} - color={userReaction !== undefined ? "success" : undefined} - variant="filled" - label={ - -
- -
-
- {p.message.reactions.get(r)?.length} -
+ + {reactions + .map((r) => p.users.get(r.account)?.display_name) + .join("\n")}
} - /> + > + handleToggleReaction(r, userReaction), + }, + label: { style: { height: "2em" } }, + }} + color={userReaction !== undefined ? "success" : undefined} + variant="filled" + label={ + +
+ +
+
+ {reactions.length} +
+
+ } + /> + ); })}