2019-11-19 01:41:08 +03:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
|
|
|
|
export default class ContactTile extends Component {
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { props } = this;
|
|
|
|
|
2020-03-07 01:53:06 +03:00
|
|
|
let data = _.get(props.data, "invites", false);
|
|
|
|
let inviteNum = 0;
|
|
|
|
|
|
|
|
if (data && "/contacts" in data) {
|
|
|
|
inviteNum = Object.keys(data["/contacts"]).length;
|
|
|
|
}
|
|
|
|
|
|
|
|
let numNotificationsElem =
|
|
|
|
inviteNum > 0 ? (
|
|
|
|
<p
|
|
|
|
className="absolute green2 white-d"
|
|
|
|
style={{
|
|
|
|
bottom: 6,
|
|
|
|
fontWeight: 400,
|
|
|
|
fontSize: 12,
|
|
|
|
lineHeight: "20px"
|
|
|
|
}}>
|
|
|
|
{inviteNum > 99 ? "99+" : inviteNum}
|
|
|
|
</p>
|
|
|
|
) : (
|
|
|
|
<div />
|
|
|
|
);
|
|
|
|
|
2019-11-19 01:41:08 +03:00
|
|
|
return (
|
2020-03-07 01:53:06 +03:00
|
|
|
<div
|
|
|
|
className={
|
|
|
|
"w-100 h-100 relative bg-white bg-gray0-d " + "b--black b--gray1-d ba"
|
|
|
|
}>
|
2020-03-04 22:50:11 +03:00
|
|
|
<a className="w-100 h-100 db pa2 bn" href="/~groups">
|
2020-03-07 01:53:06 +03:00
|
|
|
<p className="black white-d absolute f9" style={{ left: 8, top: 8 }}>
|
2020-03-04 22:50:11 +03:00
|
|
|
Groups
|
2019-11-19 01:41:08 +03:00
|
|
|
</p>
|
2019-11-23 06:37:01 +03:00
|
|
|
<img
|
2020-02-22 05:58:02 +03:00
|
|
|
className="absolute invert-d"
|
2020-02-06 02:16:56 +03:00
|
|
|
style={{ left: 39, top: 39 }}
|
2020-03-04 22:50:11 +03:00
|
|
|
src="/~groups/img/Tile.png"
|
2020-02-06 02:16:56 +03:00
|
|
|
width={48}
|
|
|
|
height={48}
|
2019-11-23 06:37:01 +03:00
|
|
|
/>
|
2020-03-07 01:53:06 +03:00
|
|
|
{numNotificationsElem}
|
2019-11-19 01:41:08 +03:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
window['contact-viewTile'] = ContactTile;
|