aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Contact.js
blob: dd68d3385b8c4a484422c81302c01e79c42a7a95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import React from 'react';
import { UserType } from './Types';

import Avatar from './Avatar';

const Contact = React.memo(({ 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 Contact;

Contact.propTypes = {
    user: UserType
};