diff --git a/src/components/views/avatars/RoomAvatar.js b/src/components/views/avatars/RoomAvatar.js index 876f40c52f..499e575227 100644 --- a/src/components/views/avatars/RoomAvatar.js +++ b/src/components/views/avatars/RoomAvatar.js @@ -17,6 +17,7 @@ import React from "react"; import PropTypes from 'prop-types'; import {ContentRepo} from "matrix-js-sdk"; import MatrixClientPeg from "../../../MatrixClientPeg"; +import Modal from '../../../Modal'; import sdk from "../../../index"; module.exports = React.createClass({ @@ -31,6 +32,7 @@ module.exports = React.createClass({ width: PropTypes.number, height: PropTypes.number, resizeMethod: PropTypes.string, + viewAvatarOnClick: PropTypes.bool, }, getDefaultProps: function() { @@ -159,6 +161,19 @@ module.exports = React.createClass({ } }, + onRoomAvatarClick: function() { + const avatarUrl = this.props.room.getAvatarUrl( + MatrixClientPeg.get().getHomeserverUrl(), + null, null, null, false); + const ImageView = sdk.getComponent("elements.ImageView"); + const params = { + src: avatarUrl, + name: this.props.room.name, + }; + + Modal.createDialog(ImageView, params, "mx_Dialog_lightbox"); + }, + render: function() { const BaseAvatar = sdk.getComponent("avatars.BaseAvatar"); @@ -169,7 +184,8 @@ module.exports = React.createClass({ return ( + urls={this.state.urls} + onClick={this.props.viewAvatarOnClick ? this.onRoomAvatarClick : null} /> ); }, }); diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index 19162c60cd..1851e03383 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -327,9 +327,8 @@ module.exports = React.createClass({ ); } else if (this.props.room || (this.props.oobData && this.props.oobData.name)) { roomAvatar = ( -
- -
+ ); }