mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 06:03:27 +08:00
Adding multiline comments.
This commit is contained in:
@@ -121,7 +121,7 @@ class CommentStream extends Component {
|
||||
<hr aria-hidden={true}/>
|
||||
<AuthorName name={comment.username}/>
|
||||
<PubDate created_at={comment.created_at}/>
|
||||
<Content content={comment.body}/>
|
||||
<Content body={comment.body}/>
|
||||
<div className="commentActions">
|
||||
{
|
||||
// <Flag
|
||||
@@ -151,7 +151,7 @@ class CommentStream extends Component {
|
||||
<hr aria-hidden={true}/>
|
||||
<AuthorName name={reply.username}/>
|
||||
<PubDate created_at={reply.created_at}/>
|
||||
<Content content={reply.body}/>
|
||||
<Content body={reply.body}/>
|
||||
<div className="replyActions">
|
||||
{
|
||||
// <Flag
|
||||
|
||||
@@ -122,4 +122,5 @@ hr {
|
||||
|
||||
.coral-plugin-pubdate-text {
|
||||
color: #CCC;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
import React from 'react'
|
||||
const name = 'coral-plugin-replies'
|
||||
|
||||
const Content = (props) => <div
|
||||
className={name + '-text'}
|
||||
style={props.styles && props.styles.text}>
|
||||
{props.content}
|
||||
</div>
|
||||
const Content = ({body, styles}) => {
|
||||
const textbreaks = body.split('\n')
|
||||
return <div
|
||||
className={name + '-text'}
|
||||
style={styles && styles.text}>
|
||||
{
|
||||
textbreaks.map((line, i) => <span key={i} className={name+'-line'}>
|
||||
{line} <br className={name+'-linebreak'}/>
|
||||
</span>)
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
export default Content
|
||||
|
||||
Reference in New Issue
Block a user