From ce9d9ed32757e30c32fa9fe29d04491c3d0550d1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 16 Jun 2018 23:32:45 +0300 Subject: Message navigation panel --- vnext/src/components/Feeds.js | 2 +- vnext/src/components/Message.js | 130 ++++++++++++++++++++++++++++------------ vnext/src/components/Thread.js | 2 +- 3 files changed, 93 insertions(+), 41 deletions(-) (limited to 'vnext/src/components') diff --git a/vnext/src/components/Feeds.js b/vnext/src/components/Feeds.js index 9748c113..e79d7f83 100644 --- a/vnext/src/components/Feeds.js +++ b/vnext/src/components/Feeds.js @@ -57,7 +57,7 @@ class Feed extends React.Component { render() { var nodes = this.state.msgs.map(msg => { - return (); + return (); }); return this.state.msgs.length > 0 ? (
{nodes}
diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index d3148141..9fce97d9 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -2,54 +2,106 @@ import React from 'react'; import PropTypes from 'prop-types'; import ReactMarkdown from 'react-markdown'; -export default class Message extends React.Component { - render() { - const msg = this.props.data; +import Icon from './Icon'; + +export default function Message(props) { + const msg = props.data; + const visitor = props.visitor; return ( - +
+
+ +
+ {`${msg.user.uname}`} +
+
+ + + +
+
+ +
+
+ + {msg.photo && +

+ +

+ } + +
); - } } function Tags(props) { - return props.data && props.data.map(tag => { return ({ tag }) }) + return props.data && props.data.map(tag => { return ({tag}) }) } Message.propTypes = { data: PropTypes.shape({ - mid: PropTypes.number.isRequired, - user: PropTypes.shape({ - uid: PropTypes.number.isRequired, - uname: PropTypes.string.isRequired - }), - timestamp: PropTypes.string.isRequired, - body: PropTypes.string + mid: PropTypes.number.isRequired, + user: PropTypes.shape({ + uid: PropTypes.number.isRequired, + uname: PropTypes.string.isRequired + }), + timestamp: PropTypes.string.isRequired, + body: PropTypes.string }) }; diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index 1a3ac862..a1abdd6c 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -37,7 +37,7 @@ export default class Thread extends React.Component { } render() { return this.state.replies && this.state.replies.length > 0 ? ( - + ) : ( ); -- cgit v1.2.3