aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Thread.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/components/Thread.js')
-rw-r--r--vnext/src/components/Thread.js36
1 files changed, 16 insertions, 20 deletions
diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js
index 4cf36747..6830a821 100644
--- a/vnext/src/components/Thread.js
+++ b/vnext/src/components/Thread.js
@@ -4,6 +4,7 @@ import * as qs from 'query-string';
import moment from 'moment';
import Message from './Message';
+import MessageInput from './MessageInput';
import Spinner from './Spinner';
import Avatar from './Avatar';
@@ -60,25 +61,8 @@ export default class Thread extends React.Component {
{
this.loaded() ? (
<Message data={msg} visitor={this.props.visitor}>
- <form className="msg-comment-target">
- <input type="hidden" name="mid" value={msg.mid} />
- <div className="msg-comment">
- <div className="ta-wrapper">
- <textarea name="body" rows="1" className="reply" placeholder="Write a comment..."></textarea>
- </div>
- </div>
- </form>
- {
- msg.recommendations && (
- <div className="msg-recomms">{`Recommended by (${msg.recommendations.length}): `}
- {
- msg.recommendations.map(it => (
- <Link to={`/${it}/`}>{it}</Link>
- )).reduce((prev, curr) => [prev, ', ', curr])
- }
- </div>
- )
- }
+ <MessageInput data={msg} />
+ <Recommendations src={msg.recommendations} />
</Message>
) : (
<Spinner />
@@ -159,6 +143,18 @@ export default class Thread extends React.Component {
}
</React.Fragment>
)
-
}
}
+
+function Recommendations(props) {
+ const recomms = props.src;
+ return recomms && (
+ <div className="msg-recomms">{`Recommended by (${recomms.length}): `}
+ {
+ recomms.map(it => (
+ <Link key={it} to={`/${it}/`}>{it}</Link>
+ )).reduce((prev, curr) => [prev, ', ', curr])
+ }
+ </div>
+ ) || null;
+}