You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-17 17:42:41 +03:00
Make UserOnlineDot more generic
This commit is contained in:
@@ -380,8 +380,8 @@ module.exports = createReactClass({
|
||||
/>;
|
||||
|
||||
if (this.props.room.getMember(dmUserId).membership === "join") {
|
||||
const RoomTileOnlineDot = sdk.getComponent('rooms.RoomTileOnlineDot');
|
||||
dmOnline = <RoomTileOnlineDot userId={dmUserId} />;
|
||||
const UserOnlineDot = sdk.getComponent('rooms.UserOnlineDot');
|
||||
dmOnline = <UserOnlineDot userId={dmUserId} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import PropTypes from "prop-types";
|
||||
import {useEventEmitter} from "../../../hooks/useEventEmitter";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
|
||||
const RoomTileOnlineDot = ({userId}) => {
|
||||
const UserOnlineDot = ({userId}) => {
|
||||
const cli = useContext(MatrixClientContext);
|
||||
const user = useMemo(() => cli.getUser(userId), [cli, userId]);
|
||||
|
||||
@@ -38,11 +38,11 @@ const RoomTileOnlineDot = ({userId}) => {
|
||||
useEventEmitter(user, "User.currentlyActive", currentlyActiveHandler);
|
||||
useEventEmitter(user, "User.presence", currentlyActiveHandler);
|
||||
|
||||
return isOnline ? <span className="mx_RoomTile_online_dot" /> : null;
|
||||
return isOnline ? <span className="mx_UserOnlineDot" /> : null;
|
||||
};
|
||||
|
||||
RoomTileOnlineDot.propTypes = {
|
||||
UserOnlineDot.propTypes = {
|
||||
userId: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default RoomTileOnlineDot;
|
||||
export default UserOnlineDot;
|
||||
Reference in New Issue
Block a user