aboutsummaryrefslogblamecommitdiff
path: root/vnext/src/components/Contact.js
blob: 24aabe1549390803f436247d574a9a5721ec8b8c (plain) (tree)
1
2
3
4
5
6
7
8
9
                          
                                   
                                   

                              
                                            
            
                                                                     

                                                                                   
      
 
 
                                   
                     
                           
  
import React from 'react';
import PropTypes from 'prop-types';
import { UserType } from './Types';

import Avatar from './Avatar';

function Contact({ user, style, ...rest }) {
    return (
        <Avatar user={user} link={`/pm/${user.uname}`} style={style}>
            {user.unreadCount && <span className="badge">{user.unreadCount}</span>}
            <div className="msg-ts">{user.lastMessageText}</div>
        </Avatar>
    );
}

export default React.memo(Contact);

Contact.propTypes = {
    user: UserType,
    style: PropTypes.object
};