summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_right.jsx
diff options
context:
space:
mode:
authorasaadmahmoodspin <asaad@battlehouse.com>2015-07-02 23:18:00 +0500
committerasaadmahmoodspin <asaad@battlehouse.com>2015-07-02 23:18:00 +0500
commit74cfb65be1720f5dd18a5e7a19889158c1abc947 (patch)
tree6e21d8b553a17d780faa826686e8e2b79f94959b /web/react/components/post_right.jsx
parent288bfbbd56d4c931bd0792a24ac96614f3eeb518 (diff)
parent9fca35cad531fe040155ba460577b0c3eba6b24e (diff)
downloadchat-74cfb65be1720f5dd18a5e7a19889158c1abc947.tar.gz
chat-74cfb65be1720f5dd18a5e7a19889158c1abc947.tar.bz2
chat-74cfb65be1720f5dd18a5e7a19889158c1abc947.zip
Merge pull request #2 from rgarmsen2295/mm-1453
MM-1453 Added additional class to the markup indicating if the post came from the current user
Diffstat (limited to 'web/react/components/post_right.jsx')
-rw-r--r--web/react/components/post_right.jsx20
1 files changed, 15 insertions, 5 deletions
diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index 43be60afa..15a058c5f 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -68,9 +68,14 @@ RootPost = React.createClass({
var filenames = this.props.post.filenames;
var isOwner = UserStore.getCurrentId() == this.props.post.user_id;
- var type = "Post"
+ var type = "Post";
if (this.props.post.root_id.length > 0) {
- type = "Comment"
+ type = "Comment";
+ }
+
+ var currentUser = "";
+ if (UserStore.getCurrentId() === this.props.post.user_id) {
+ currentUser = "current--user";
}
if (filenames) {
@@ -84,7 +89,7 @@ RootPost = React.createClass({
if (fileSplit.length < 2) continue;
var ext = fileSplit[fileSplit.length-1];
- fileSplit.splice(fileSplit.length-1,1)
+ fileSplit.splice(fileSplit.length-1,1);
var filePath = fileSplit.join('.');
var filename = filePath.split('/')[filePath.split('/').length-1];
@@ -111,7 +116,7 @@ RootPost = React.createClass({
}
return (
- <div className="post post--root">
+ <div className={"post post--root " + currentUser}>
<div className="post-profile-img__container">
<img className="post-profile-img" src={"/api/v1/users/" + this.props.post.user_id + "/image"} height="36" width="36" />
</div>
@@ -170,6 +175,11 @@ CommentPost = React.createClass({
var commentClass = "post";
+ var currentUser = "";
+ if (UserStore.getCurrentId() === this.props.post.user_id) {
+ currentUser = "current--user";
+ }
+
var postImageModalId = "rhs_comment_view_image_modal_" + this.props.post.id;
var filenames = this.props.post.filenames;
var isOwner = UserStore.getCurrentId() == this.props.post.user_id;
@@ -219,7 +229,7 @@ CommentPost = React.createClass({
var message = utils.textToJsx(this.props.post.message);
return (
- <div className={commentClass}>
+ <div className={commentClass + " " + currentUser}>
<div className="post-profile-img__container">
<img className="post-profile-img" src={"/api/v1/users/" + this.props.post.user_id + "/image"} height="36" width="36" />
</div>