link fe: render unseen count in the launch tile

This commit is contained in:
Fang 2020-02-14 02:03:19 +01:00
parent 45088621f4
commit c86b1c9944
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -6,7 +6,20 @@ import _ from 'lodash';
export default class LinkTile extends Component {
render() {
const { props } = this;
const unseenCount = this.props.data.unseen || 0;
let displayUnseen = unseenCount <= 0
? null
: <p
className="absolute green2"
style={{
bottom: 6,
fontWeight: 400,
fontSize: 12,
lineHeight: "20px"
}}>
{unseenCount > 99 ? "99+" : unseenCount}
</p>;
return (
<div className="w-100 h-100 relative ba b--black bg-white">
@ -23,6 +36,7 @@ export default class LinkTile extends Component {
width={48}
height={48}
/>
{displayUnseen}
</a>
</div>
);
@ -30,4 +44,4 @@ export default class LinkTile extends Component {
}
window['link-server-hookTile'] = LinkTile;
window['link-viewTile'] = LinkTile;