summaryrefslogtreecommitdiffstats
path: root/web
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
parentdb37897538f134b29784453797510c20e1e9303c (diff)
downloadchat-0e69a871bb44705a23b82ad46fac41e1cad5fb3d.tar.gz
chat-0e69a871bb44705a23b82ad46fac41e1cad5fb3d.tar.bz2
chat-0e69a871bb44705a23b82ad46fac41e1cad5fb3d.zip
Adding reply functionality
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post_info.jsx33
-rw-r--r--web/react/utils/constants.jsx1
-rw-r--r--web/react/utils/utils.jsx2
-rw-r--r--web/sass-files/sass/partials/_post.scss18
-rw-r--r--web/sass-files/sass/partials/_responsive.scss2
5 files changed, 34 insertions, 22 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'
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 851bc5f6c..e1a4b8a8a 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -168,6 +168,7 @@ export default {
OFFLINE_ICON_SVG: "<svg version='1.1'id='Layer_1' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:cc='http://creativecommons.org/ns#' inkscape:version='0.48.4 r9939' sodipodi:docname='TRASH_1_4.svg'xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='-299 391 12 12'style='enable-background:new -299 391 12 12;' xml:space='preserve'> <sodipodi:namedview inkscape:cx='26.358185' inkscape:zoom='1.18' bordercolor='#666666' pagecolor='#ffffff' borderopacity='1' objecttolerance='10' inkscape:cy='139.7898' gridtolerance='10' guidetolerance='10' showgrid='false' showguides='true' id='namedview6' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-width='1366' inkscape:current-layer='Layer_1' inkscape:window-height='705' inkscape:window-y='-8' inkscape:window-maximized='1' inkscape:window-x='-8'> <sodipodi:guide position='50.036793,85.991376' orientation='1,0' id='guide2986'></sodipodi:guide> <sodipodi:guide position='58.426196,66.216355' orientation='0,1' id='guide3047'></sodipodi:guide> </sodipodi:namedview> <g> <g> <ellipse class='offline--icon' cx='-294.5' cy='394' rx='2.5' ry='2.5'/> <path class='offline--icon' d='M-294.3,399.7c0-0.4,0.1-0.8,0.2-1.2c-0.1,0-0.2,0-0.4,0c-2.5,0-2.5-2-2.5-2s-1,0.1-1.2,0.5c-0.4,0.6-0.6,1.7-0.7,2.5 c0,0.1-0.1,0.5,0,0.6c0.2,1.3,2.2,2.3,4.4,2.4h0.1h0.1c0.3,0,0.7,0,1-0.1C-293.9,401.6-294.3,400.7-294.3,399.7z'/> </g> </g> <g> <path class='offline--icon' d='M-288.9,399.4l1.8-1.8c0.1-0.1,0.1-0.3,0-0.3l-0.7-0.7c-0.1-0.1-0.3-0.1-0.3,0l-1.8,1.8l-1.8-1.8c-0.1-0.1-0.3-0.1-0.3,0 l-0.7,0.7c-0.1,0.1-0.1,0.3,0,0.3l1.8,1.8l-1.8,1.8c-0.1,0.1-0.1,0.3,0,0.3l0.7,0.7c0.1,0.1,0.3,0.1,0.3,0l1.8-1.8l1.8,1.8 c0.1,0.1,0.3,0.1,0.3,0l0.7-0.7c0.1-0.1,0.1-0.3,0-0.3L-288.9,399.4z'/> </g> </svg>",
MENU_ICON: "<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'width='4px' height='16px' viewBox='0 0 8 32' enable-background='new 0 0 8 32' xml:space='preserve'> <g> <circle cx='4' cy='4.062' r='4'/> <circle cx='4' cy='16' r='4'/> <circle cx='4' cy='28' r='4'/> </g> </svg>",
COMMENT_ICON: "<svg version='1.1' id='Layer_2' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'width='15px' height='15px' viewBox='1 1.5 15 15' enable-background='new 1 1.5 15 15' xml:space='preserve'> <g> <g> <path fill='#211B1B' d='M14,1.5H3c-1.104,0-2,0.896-2,2v8c0,1.104,0.896,2,2,2h1.628l1.884,3l1.866-3H14c1.104,0,2-0.896,2-2v-8 C16,2.396,15.104,1.5,14,1.5z M15,11.5c0,0.553-0.447,1-1,1H8l-1.493,2l-1.504-1.991L5,12.5H3c-0.552,0-1-0.447-1-1v-8 c0-0.552,0.448-1,1-1h11c0.553,0,1,0.448,1,1V11.5z'/> </g> </g> </svg>",
+ REPLY_ICON: "<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'viewBox='-158 242 18 18' style='enable-background:new -158 242 18 18;' xml:space='preserve'> <path d='M-142.2,252.6c-2-3-4.8-4.7-8.3-4.8v-3.3c0-0.2-0.1-0.3-0.2-0.3s-0.3,0-0.4,0.1l-6.9,6.2c-0.1,0.1-0.1,0.2-0.1,0.3 c0,0.1,0,0.2,0.1,0.3l6.9,6.4c0.1,0.1,0.3,0.1,0.4,0.1c0.1-0.1,0.2-0.2,0.2-0.4v-3.8c4.2,0,7.4,0.4,9.6,4.4c0.1,0.1,0.2,0.2,0.3,0.2 c0,0,0.1,0,0.1,0c0.2-0.1,0.3-0.3,0.2-0.4C-140.2,257.3-140.6,255-142.2,252.6z M-150.8,252.5c-0.2,0-0.4,0.2-0.4,0.4v3.3l-6-5.5 l6-5.3v2.8c0,0.2,0.2,0.4,0.4,0.4c3.3,0,6,1.5,8,4.5c0.5,0.8,0.9,1.6,1.2,2.3C-144,252.8-147.1,252.5-150.8,252.5z'/> </svg>",
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) {
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index ef2366686..1f7a55cd0 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -408,7 +408,7 @@ body.ios {
@include legacy-pie-clearfix;
&:hover {
- .dropdown, .comment-icon__container {
+ .dropdown, .comment-icon__container, .post__reply {
visibility: visible;
}
.permalink-icon {
@@ -597,7 +597,7 @@ body.ios {
position: absolute;
right: 0;
top: 30px;
- width: 65px;
+ width: 85px;
white-space: nowrap;
}
@@ -666,7 +666,7 @@ body.ios {
word-wrap: break-word;
padding: 0.2em 0.5em 0em;
@include legacy-pie-clearfix;
- width: calc(100% - 75px);
+ width: calc(100% - 95px);
p {
margin: 0 0 0.4em;
@@ -754,6 +754,18 @@ body.ios {
visibility: hidden;
}
+ .post__reply {
+ display: inline-block;
+ margin-right: 6px;
+ visibility: hidden;
+ svg {
+ width: 18px;
+ top: 3px;
+ fill: inherit;
+ position: relative;
+ }
+ }
+
.comment-icon__container {
fill: $primary-color;
display: inline-block;
diff --git a/web/sass-files/sass/partials/_responsive.scss b/web/sass-files/sass/partials/_responsive.scss
index 8491869a6..7d1210f64 100644
--- a/web/sass-files/sass/partials/_responsive.scss
+++ b/web/sass-files/sass/partials/_responsive.scss
@@ -92,7 +92,7 @@
}
- .dropdown {
+ .dropdown, .post__reply {
visibility: visible;
}