import React, { Component } from 'react'; import classnames from 'classnames'; import _ from 'lodash'; export default class ChatTile extends Component { render() { const { props } = this; let data = _.get(props.data, 'chat-configs', false); let inviteNum = 0; let msgNum = 0; if (data) { Object.keys(data).forEach((conf) => { console.log(conf); msgNum = msgNum + data[conf].length - data[conf].read; }); } let notificationsNum = inviteNum + msgNum; let numNotificationsElem = notificationsNum > 0 ? (

{notificationsNum > 99 ? "99+" : notificationsNum}

) : (
); return (

Messaging

{numNotificationsElem}
); } } window['chat-viewTile'] = ChatTile;