forked from matrix/element-web
make senderprofiles clickable
This commit is contained in:
parent
c6f95dfb3b
commit
d7a851a353
|
@ -21,6 +21,18 @@ var React = require('react');
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'SenderProfile',
|
displayName: 'SenderProfile',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
mxEvent: React.PropTypes.object.isRequired, // event whose sender we're showing
|
||||||
|
aux: React.PropTypes.object, // stuff to go after the sender name, if anything
|
||||||
|
onClick: React.PropTypes.func,
|
||||||
|
},
|
||||||
|
|
||||||
|
getDefaultProps: function() {
|
||||||
|
return {
|
||||||
|
onClick: function() {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
var mxEvent = this.props.mxEvent;
|
var mxEvent = this.props.mxEvent;
|
||||||
var name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender();
|
var name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender();
|
||||||
|
@ -30,7 +42,7 @@ module.exports = React.createClass({
|
||||||
name = ''; // emote message must include the name so don't duplicate it
|
name = ''; // emote message must include the name so don't duplicate it
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<span className="mx_SenderProfile">
|
<span className="mx_SenderProfile" onClick={this.props.onClick}>
|
||||||
{name} { this.props.aux }
|
{name} { this.props.aux }
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
@ -43,6 +43,7 @@ limitations under the License.
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
display: block;
|
display: block;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_EventTile .mx_MessageTimestamp {
|
.mx_EventTile .mx_MessageTimestamp {
|
||||||
|
|
Loading…
Reference in New Issue