Merge branch 'wmwragg/mention-state-indicator-round-3' into wmwragg/mention-state-menu
# resolved Conflicts: # src/components/views/rooms/RoomTile.js
This commit is contained in:
commit
a218b4e8a3
1 changed files with 14 additions and 27 deletions
|
@ -110,6 +110,7 @@ module.exports = React.createClass({
|
||||||
'mx_RoomTile_selected': this.props.selected,
|
'mx_RoomTile_selected': this.props.selected,
|
||||||
'mx_RoomTile_unread': this.props.unread,
|
'mx_RoomTile_unread': this.props.unread,
|
||||||
'mx_RoomTile_unreadNotify': notificationCount > 0,
|
'mx_RoomTile_unreadNotify': notificationCount > 0,
|
||||||
|
'mx_RoomTile_read': !(this.props.highlight || notificationCount > 0),
|
||||||
'mx_RoomTile_highlight': this.props.highlight,
|
'mx_RoomTile_highlight': this.props.highlight,
|
||||||
'mx_RoomTile_invited': (me && me.membership == 'invite'),
|
'mx_RoomTile_invited': (me && me.membership == 'invite'),
|
||||||
});
|
});
|
||||||
|
@ -117,53 +118,38 @@ module.exports = React.createClass({
|
||||||
// XXX: We should never display raw room IDs, but sometimes the
|
// XXX: We should never display raw room IDs, but sometimes the
|
||||||
// room name js sdk gives is undefined (cannot repro this -- k)
|
// room name js sdk gives is undefined (cannot repro this -- k)
|
||||||
var name = this.props.room.name || this.props.room.roomId;
|
var name = this.props.room.name || this.props.room.roomId;
|
||||||
|
|
||||||
name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon
|
name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon
|
||||||
|
|
||||||
var badge;
|
var badge;
|
||||||
var badgeContent;
|
var badgeContent;
|
||||||
var badgeClasses;
|
|
||||||
|
var badgeClasses = classNames({
|
||||||
|
'mx_RoomTile_badge': true,
|
||||||
|
'mx_RoomTile_badgeButton': this.state.badgeHover,
|
||||||
|
});
|
||||||
|
|
||||||
if (this.state.badgeHover) {
|
if (this.state.badgeHover) {
|
||||||
badgeContent = "\u00B7\u00B7\u00B7";
|
badgeContent = "\u00B7\u00B7\u00B7";
|
||||||
} else if (this.props.highlight || notificationCount > 0) {
|
} else if (this.props.highlight || notificationCount > 0) {
|
||||||
badgeContent = notificationCount ? notificationCount : '!';
|
var limitedCount = (notificationCount > 99) ? '99+' : notificationCount;
|
||||||
|
badgeContent = notificationCount ? limitedCount : '!';
|
||||||
} else {
|
} else {
|
||||||
badgeContent = '\u200B';
|
badgeContent = '\u200B';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.highlight || notificationCount > 0) {
|
|
||||||
badgeClasses = "mx_RoomTile_badge";
|
|
||||||
} else {
|
|
||||||
badgeClasses = "mx_RoomTile_badge mx_RoomTile_badge_no_unread";
|
|
||||||
}
|
|
||||||
|
|
||||||
badge = <div className={ badgeClasses } onClick={this.onBadgeClicked} onMouseEnter={this.badgeOnMouseEnter} onMouseLeave={this.badgeOnMouseLeave}>{ badgeContent }</div>;
|
badge = <div className={ badgeClasses } onClick={this.onBadgeClicked} onMouseEnter={this.badgeOnMouseEnter} onMouseLeave={this.badgeOnMouseLeave}>{ badgeContent }</div>;
|
||||||
|
|
||||||
/*
|
|
||||||
if (this.props.highlight) {
|
|
||||||
badge = <div className="mx_RoomTile_badge">!</div>;
|
|
||||||
}
|
|
||||||
else if (this.props.unread) {
|
|
||||||
badge = <div className="mx_RoomTile_badge">1</div>;
|
|
||||||
}
|
|
||||||
var nameCell;
|
|
||||||
if (badge) {
|
|
||||||
nameCell = <div className="mx_RoomTile_nameBadge"><div className="mx_RoomTile_name">{name}</div><div className="mx_RoomTile_badgeCell">{badge}</div></div>;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
nameCell = <div className="mx_RoomTile_name">{name}</div>;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
var label;
|
var label;
|
||||||
|
var tooltip;
|
||||||
if (!this.props.collapsed) {
|
if (!this.props.collapsed) {
|
||||||
var className = 'mx_RoomTile_name' + (this.props.isInvite ? ' mx_RoomTile_invite' : '');
|
var className = 'mx_RoomTile_name' + (this.props.isInvite ? ' mx_RoomTile_invite' : '');
|
||||||
let nameHTML = emojifyText(name);
|
let nameHTML = emojifyText(name);
|
||||||
if (this.props.selected) {
|
if (this.props.selected) {
|
||||||
name = <span dangerouslySetInnerHTML={nameHTML}></span>;
|
name = <span dangerouslySetInnerHTML={nameHTML}></span>;
|
||||||
label = <div onClick={this.onClick} className={ className }>{ name }</div>;
|
|
||||||
|
label = <div title={ name } onClick={this.onClick} onMouseEnter={this.badgeOnMouseEnter} onMouseLeave={this.badgeOnMouseLeave} className={ className }>{ name }</div>;
|
||||||
} else {
|
} else {
|
||||||
label = <div onClick={this.onClick} className={ className } dangerouslySetInnerHTML={nameHTML}></div>;
|
label = <div title={ name } onClick={this.onClick} onMouseEnter={this.badgeOnMouseEnter} onMouseLeave={this.badgeOnMouseLeave} className={ className } dangerouslySetInnerHTML={nameHTML}></div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.state.hover) {
|
else if (this.state.hover) {
|
||||||
|
@ -193,6 +179,7 @@ module.exports = React.createClass({
|
||||||
{ label }
|
{ label }
|
||||||
{ badge }
|
{ badge }
|
||||||
{ incomingCallBox }
|
{ incomingCallBox }
|
||||||
|
{ tooltip }
|
||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue