more actions without subscribing first

This commit is contained in:
or-else
2019-02-24 11:08:52 +03:00
parent fd32413ba1
commit 7e0aa5b93b
6 changed files with 22 additions and 25 deletions
+3 -6
View File
@@ -3,11 +3,8 @@ import React from 'react';
export default class UnreadBadge extends React.PureComponent {
render() {
var showUnreadBadge = null;
if (this.props.count > 0) {
var count = this.props.count > 9 ? "9+" : this.props.count;
showUnreadBadge = <span className="unread">{count}</span>;
}
return showUnreadBadge;
return (this.props.count > 0 ?
<span className="unread">{this.props.count > 9 ? "9+" : this.props.count}</span>
: null);
}
};