diff options
author | 2018-06-09 15:50:47 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:52 +0300 | |
commit | 733343545f2be35f192011f2741dc8c41948cac8 (patch) | |
tree | ba1d4fef36529965b1344f2016e312ad2269816a /vnext/src/components/Message.js | |
parent | 4e744b4ac064133d36f75799139607508e1cb8d1 (diff) |
many updates
Diffstat (limited to 'vnext/src/components/Message.js')
-rw-r--r-- | vnext/src/components/Message.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index ba853f5c..d3148141 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -1,9 +1,9 @@ -import React from 'react' -import PropTypes from 'prop-types' -import ReactMarkdown from 'react-markdown' +import React from 'react'; +import PropTypes from 'prop-types'; +import ReactMarkdown from 'react-markdown'; export default class Message extends React.Component { - render() { + render() { const msg = this.props.data; return ( <article itemProp="blogPost" itemScope="" itemType="http://schema.org/BlogPosting" itemRef="org"> @@ -27,21 +27,22 @@ export default class Message extends React.Component { </div> </header> <ReactMarkdown source={msg.body}/> - { msg.photo && + { msg.photo && <p className="ir"><a href={`//i.juick.com/p/${msg.mid}.${msg.attach}`} data-fname={`${msg.mid}.${msg.attach}`}> <img itemProp="image" src={`//i.juick.com/p/${msg.mid}.${msg.attach}`} alt=""/></a> </p> } </article> - )} -}; + ); + } +} function Tags(props) { return props.data && props.data.map(tag => { return (<a key={tag} href={`/tag/${ tag}`} title={ tag }>{ tag }</a>) }) } Message.propTypes = { - msg: PropTypes.shape({ + data: PropTypes.shape({ mid: PropTypes.number.isRequired, user: PropTypes.shape({ uid: PropTypes.number.isRequired, @@ -50,4 +51,5 @@ Message.propTypes = { timestamp: PropTypes.string.isRequired, body: PropTypes.string }) -} +}; + |