summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_info.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <asaad@spinpunch.com>2016-01-28 23:24:31 +0500
committerAsaad Mahmood <asaad@spinpunch.com>2016-01-28 23:24:31 +0500
commit0e69a871bb44705a23b82ad46fac41e1cad5fb3d (patch)
treec24b2be6664de31af329e004716431c0a3f24b99 /web/react/components/post_info.jsx
parentdb37897538f134b29784453797510c20e1e9303c (diff)
downloadchat-0e69a871bb44705a23b82ad46fac41e1cad5fb3d.tar.gz
chat-0e69a871bb44705a23b82ad46fac41e1cad5fb3d.tar.bz2
chat-0e69a871bb44705a23b82ad46fac41e1cad5fb3d.zip
Adding reply functionality
Diffstat (limited to 'web/react/components/post_info.jsx')
-rw-r--r--web/react/components/post_info.jsx33
1 files changed, 16 insertions, 17 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 26bd6adde..2bd1a57f7 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -22,6 +22,20 @@ export default class PostInfo extends React.Component {
this.handlePermalinkCopy = this.handlePermalinkCopy.bind(this);
}
+ createReplyLink() {
+ if (this.props.allowReply === 'true') {
+ return (
+ <div className='post__reply'>
+ <a
+ onClick={this.props.handleCommentClick}
+ href='#'
+ >
+ <span dangerouslySetInnerHTML={{__html: Constants.REPLY_ICON}}/>
+ </a>
+ </div>
+ );
+ }
+ }
createDropdown() {
var post = this.props.post;
var isOwner = UserStore.getCurrentId() === post.user_id;
@@ -42,23 +56,6 @@ export default class PostInfo extends React.Component {
dataComments = this.props.commentCount;
}
- if (this.props.allowReply === 'true') {
- dropdownContents.push(
- <li
- key='replyLink'
- role='presentation'
- >
- <a
- className='link__reply theme'
- href='#'
- onClick={this.props.handleCommentClick}
- >
- {'Reply'}
- </a>
- </li>
- );
- }
-
dropdownContents.push(
<li
key='copyLink'
@@ -181,6 +178,7 @@ export default class PostInfo extends React.Component {
}
var dropdown = this.createDropdown();
+ var replyLink = this.createReplyLink();
const permalink = TeamStore.getCurrentTeamUrl() + '/pl/' + post.id;
const copyButtonText = this.state.copiedLink ? (<div>{'Copy '}<i className='fa fa-check'/></div>) : 'Copy';
@@ -223,6 +221,7 @@ export default class PostInfo extends React.Component {
/>
</li>
<li className='col col__reply'>
+ {replyLink}
<div
className='dropdown'
ref='dotMenu'