import { useMediaAuthentication } from '../../hooks/useMediaAuthentication';
import { useOpenUserRoomProfile } from '../../state/hooks/userRoomProfile';
import { useSpaceOptionally } from '../../hooks/useSpace';
+import { getMouseEventCords } from '../../utils/dom';
export type EventReadersProps = {
room: Room;
room.roomId,
space?.roomId,
readerId,
- event.currentTarget.getBoundingClientRect(),
+ getMouseEventCords(event.nativeEvent),
'Bottom'
);
}}
import { useSpaceOptionally } from '../../../hooks/useSpace';
import { useFlattenPowerTagMembers, useGetMemberPowerTag } from '../../../hooks/useMemberPowerTag';
import { useRoomCreators } from '../../../hooks/useRoomCreators';
+import { getMouseEventCords } from '../../../utils/dom';
const SEARCH_OPTIONS: UseAsyncSearchOptions = {
limit: 1000,
const btn = evt.currentTarget as HTMLButtonElement;
const userId = btn.getAttribute('data-user-id');
if (userId) {
- openProfile(room.roomId, space?.roomId, userId, btn.getBoundingClientRect());
+ openProfile(room.roomId, space?.roomId, userId, getMouseEventCords(evt.nativeEvent));
}
};
import { useMediaAuthentication } from '../../../hooks/useMediaAuthentication';
import { useOpenUserRoomProfile } from '../../../state/hooks/userRoomProfile';
import { useSpaceOptionally } from '../../../hooks/useSpace';
+import { getMouseEventCords } from '../../../utils/dom';
export type ReactionViewerProps = {
room: Room;
room.roomId,
space?.roomId,
senderId,
- event.currentTarget.getBoundingClientRect(),
+ getMouseEventCords(event.nativeEvent),
'Bottom'
);
}}
}
return false;
};
+
+export const getMouseEventCords = (event: MouseEvent) => ({
+ x: event.clientX,
+ y: event.clientY,
+ width: 0,
+ height: 0,
+});