mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
put a black badge on unread notifications, and a red one for unread highlights
This commit is contained in:
parent
4631648f26
commit
b19a318b2d
1 changed files with 6 additions and 1 deletions
|
@ -63,10 +63,15 @@ module.exports = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
var myUserId = MatrixClientPeg.get().credentials.userId;
|
var myUserId = MatrixClientPeg.get().credentials.userId;
|
||||||
var me = this.props.room.currentState.members[myUserId];
|
var me = this.props.room.currentState.members[myUserId];
|
||||||
|
|
||||||
|
var notificationCount = this.props.room.getUnreadNotificationCount();
|
||||||
|
// var highlightCount = this.props.room.getUnreadNotificationCount("highlight");
|
||||||
|
|
||||||
var classes = classNames({
|
var classes = classNames({
|
||||||
'mx_RoomTile': true,
|
'mx_RoomTile': true,
|
||||||
'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_highlight': this.props.highlight,
|
'mx_RoomTile_highlight': this.props.highlight,
|
||||||
'mx_RoomTile_invited': (me && me.membership == 'invite'),
|
'mx_RoomTile_invited': (me && me.membership == 'invite'),
|
||||||
});
|
});
|
||||||
|
@ -77,7 +82,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
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;
|
||||||
if (this.props.highlight) {
|
if (this.props.highlight || notificationCount > 0) {
|
||||||
badge = <div className="mx_RoomTile_badge"/>;
|
badge = <div className="mx_RoomTile_badge"/>;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue