aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Contact.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/ui/Contact.js')
-rw-r--r--vnext/src/ui/Contact.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/vnext/src/ui/Contact.js b/vnext/src/ui/Contact.js
new file mode 100644
index 00000000..24aabe15
--- /dev/null
+++ b/vnext/src/ui/Contact.js
@@ -0,0 +1,21 @@
+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
+};