Added styling for unknown addresses

pull/21833/head
wmwragg 2016-09-12 17:25:14 +01:00
parent 95d9df7534
commit 5a0a72ee46
1 changed files with 10 additions and 3 deletions

View File

@ -60,7 +60,7 @@ module.exports = React.createClass({
imgUrl = Avatar.avatarUrlForUser(user, 25, 25, "crop"); imgUrl = Avatar.avatarUrlForUser(user, 25, 25, "crop");
} else { } else {
name="Unknown"; name="Unknown";
imgUrl = "img/icon-email-user.svg"; imgUrl = "img/avatar-error.svg";
} }
} else if (addrType === "email") { } else if (addrType === "email") {
email = this.props.address; email = this.props.address;
@ -68,7 +68,7 @@ module.exports = React.createClass({
imgUrl = "img/icon-email-user.svg"; imgUrl = "img/icon-email-user.svg";
} else { } else {
name="Unknown"; name="Unknown";
imgUrl = "img/icon-email-user.svg"; imgUrl = "img/avatar-error.svg";
} }
var network; var network;
@ -81,6 +81,7 @@ module.exports = React.createClass({
} }
var info; var info;
var error = false;
if (userId) { if (userId) {
var nameClasses = classNames({ var nameClasses = classNames({
"mx_AddressTile_name": true, "mx_AddressTile_name": true,
@ -108,6 +109,7 @@ module.exports = React.createClass({
<div className={emailClasses}>{ email }</div> <div className={emailClasses}>{ email }</div>
); );
} else { } else {
error = true;
var unknownClasses = classNames({ var unknownClasses = classNames({
"mx_AddressTile_unknown": true, "mx_AddressTile_unknown": true,
"mx_AddressTile_justified": this.props.justified, "mx_AddressTile_justified": this.props.justified,
@ -118,6 +120,11 @@ module.exports = React.createClass({
); );
} }
var classes = classNames({
"mx_AddressTile": true,
"mx_AddressTile_error": error,
});
var dismiss; var dismiss;
if (this.props.canDismiss) { if (this.props.canDismiss) {
dismiss = ( dismiss = (
@ -128,7 +135,7 @@ module.exports = React.createClass({
} }
return ( return (
<div className="mx_AddressTile"> <div className={classes}>
{ network } { network }
<div className="mx_AddressTile_avatar"> <div className="mx_AddressTile_avatar">
<BaseAvatar width={25} height={25} name={name} title={name} url={imgUrl} /> <BaseAvatar width={25} height={25} name={name} title={name} url={imgUrl} />