From 7e60012bd4842e3e90d4dbbae0840b2a78ca341e Mon Sep 17 00:00:00 2001 From: wmwragg Date: Wed, 7 Sep 2016 10:55:44 +0100 Subject: [PATCH] Added justification for the AddressTile, when requested --- .../views/dialogs/ChatInviteDialog.js | 2 +- src/components/views/elements/AddressTile.js | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 95ecdacd81..ccbb2cc8c6 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -175,7 +175,7 @@ module.exports = React.createClass({ queryList.push(
- +
); } diff --git a/src/components/views/elements/AddressTile.js b/src/components/views/elements/AddressTile.js index 6ea7342b41..3a6f26697e 100644 --- a/src/components/views/elements/AddressTile.js +++ b/src/components/views/elements/AddressTile.js @@ -17,6 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); +var classNames = require('classnames'); var sdk = require("../../../index"); var Avatar = require('../../../Avatar'); @@ -27,12 +28,14 @@ module.exports = React.createClass({ user: React.PropTypes.object.isRequired, canDismiss: React.PropTypes.bool, onDismissed: React.PropTypes.func, + justified: React.PropTypes.bool, }, getDefaultProps: function() { return { canDismiss: false, onDismissed: function() {}, // NOP + justified: false, }; }, @@ -52,13 +55,23 @@ module.exports = React.createClass({ ); } + var nameClasses = classNames({ + "mx_AddressTile_name": true, + "mx_AddressTile_justified": this.props.justified, + }); + + var idClasses = classNames({ + "mx_AddressTile_id": true, + "mx_AddressTile_justified": this.props.justified, + }); + return (
-
{ name }
-
{ userId }
+
{ name }
+
{ userId }
{ dismiss }
);