2020-01-23 02:16:44 +03:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
|
|
|
|
export default class LinkTile extends Component {
|
|
|
|
|
|
|
|
render() {
|
2020-02-14 04:03:19 +03:00
|
|
|
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>;
|
2020-01-23 02:16:44 +03:00
|
|
|
|
|
|
|
return (
|
2020-02-06 02:16:56 +03:00
|
|
|
<div className="w-100 h-100 relative ba b--black bg-white">
|
|
|
|
<a className="w-100 h-100 db pa2 bn" href="/~link">
|
2020-01-23 02:16:44 +03:00
|
|
|
<p
|
2020-02-06 02:16:56 +03:00
|
|
|
className="f9 black absolute"
|
|
|
|
style={{ left: 8, top: 8 }}>
|
2020-01-23 02:16:44 +03:00
|
|
|
Links
|
|
|
|
</p>
|
|
|
|
<img
|
|
|
|
className="absolute"
|
2020-02-06 02:16:56 +03:00
|
|
|
style={{ left: 39, top: 39 }}
|
2020-01-23 02:16:44 +03:00
|
|
|
src="/~link/img/Tile.png"
|
2020-02-06 02:16:56 +03:00
|
|
|
width={48}
|
|
|
|
height={48}
|
2020-01-23 02:16:44 +03:00
|
|
|
/>
|
2020-02-14 04:03:19 +03:00
|
|
|
{displayUnseen}
|
2020-01-23 02:16:44 +03:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-02-14 04:03:19 +03:00
|
|
|
window['link-viewTile'] = LinkTile;
|