mirror of
https://github.com/wassname/talk.git
synced 2026-08-08 11:28:12 +08:00
replaced eslint:recommended with prettier
This commit is contained in:
@@ -3,22 +3,22 @@ import Linkify from 'react-linkify';
|
||||
|
||||
const name = 'talk-plugin-comment-content';
|
||||
|
||||
const CommentContent = ({comment}) => {
|
||||
const CommentContent = ({ comment }) => {
|
||||
const textbreaks = comment.body.split('\n');
|
||||
return <span className={`${name}-text`}>
|
||||
{
|
||||
textbreaks.map((line, i) => {
|
||||
return (
|
||||
<span className={`${name}-text`}>
|
||||
{textbreaks.map((line, i) => {
|
||||
return (
|
||||
<span key={i} className={`${name}-line`}>
|
||||
<Linkify properties={{target: '_blank'}}>
|
||||
{line.trim()}
|
||||
</Linkify>
|
||||
{i !== textbreaks.length - 1 && <br className={`${name}-linebreak`}/>}
|
||||
<Linkify properties={{ target: '_blank' }}>{line.trim()}</Linkify>
|
||||
{i !== textbreaks.length - 1 && (
|
||||
<br className={`${name}-linebreak`} />
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
})
|
||||
}
|
||||
</span>;
|
||||
})}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export default CommentContent;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import {gql} from 'react-apollo';
|
||||
import {withFragments} from 'plugin-api/beta/client/hocs';
|
||||
import { gql } from 'react-apollo';
|
||||
import { withFragments } from 'plugin-api/beta/client/hocs';
|
||||
import CommentContent from '../components/CommentContent';
|
||||
|
||||
export default withFragments({
|
||||
comment: gql`
|
||||
fragment TalkPluginCommentContent_comment on Comment {
|
||||
body
|
||||
}`
|
||||
}
|
||||
`,
|
||||
})(CommentContent);
|
||||
|
||||
@@ -2,6 +2,6 @@ import CommentContent from './containers/CommentContent';
|
||||
|
||||
export default {
|
||||
slots: {
|
||||
commentContent: [CommentContent]
|
||||
}
|
||||
commentContent: [CommentContent],
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user