From 0e69a871bb44705a23b82ad46fac41e1cad5fb3d Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Thu, 28 Jan 2016 23:24:31 +0500 Subject: Adding reply functionality --- web/react/components/post_info.jsx | 33 ++++++++++++++++----------------- web/react/utils/constants.jsx | 1 + web/react/utils/utils.jsx | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'web/react') 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 ( +
+ + + +
+ ); + } + } 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( -
  • - - {'Reply'} - -
  • - ); - } - dropdownContents.push(
  • {'Copy '}) : 'Copy'; @@ -223,6 +221,7 @@ export default class PostInfo extends React.Component { />
  • + {replyLink}
    ", MENU_ICON: " ", COMMENT_ICON: " ", + REPLY_ICON: " ", UPDATE_TYPING_MS: 5000, THEMES: { default: { diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 82e9bc447..494c38bdb 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -714,7 +714,7 @@ export function applyTheme(theme) { if (theme.linkColor) { changeCss('a, a:focus, a:hover, .btn, .btn:focus, .btn:hover', 'color:' + theme.linkColor, 1); - changeCss('.post .comment-icon__container', 'fill:' + theme.linkColor, 1); + changeCss('.post .comment-icon__container, .post .post__reply', 'fill:' + theme.linkColor, 1); } if (theme.buttonBg) { -- cgit v1.2.3-1-g7c22 From ce2ec34e585bd5f9c319936ae66fe764dabac0e3 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 29 Jan 2016 00:04:42 +0500 Subject: Adding reply icon --- web/react/components/post_info.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'web/react') diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index 2bd1a57f7..73b47024c 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -24,8 +24,14 @@ export default class PostInfo extends React.Component { } createReplyLink() { if (this.props.allowReply === 'true') { + var hideReply = ''; + + if (this.props.commentCount >= 1) { + hideReply = ' post__reply--hide'; + } + return ( -
    +