diff options
author | Corey Hulen <corey@hulen.com> | 2015-07-02 11:16:22 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-07-02 11:16:22 -0800 |
commit | a3db8e83f68f4341b473e77986dc7ca93f97c2d0 (patch) | |
tree | f2d5178c4555acd1f231bdf50d4fc25312d8a519 /web/react/components/post_right.jsx | |
parent | e233d0d2d20bcb12540e39829a2bce754caa185c (diff) | |
parent | 97c112c42707f92279b8a85f1f0ad8517fa59f18 (diff) | |
download | chat-a3db8e83f68f4341b473e77986dc7ca93f97c2d0.tar.gz chat-a3db8e83f68f4341b473e77986dc7ca93f97c2d0.tar.bz2 chat-a3db8e83f68f4341b473e77986dc7ca93f97c2d0.zip |
Merge pull request #123 from asaadmahmoodspin/mm-1426
MM-1426 - Updating UI
Diffstat (limited to 'web/react/components/post_right.jsx')
-rw-r--r-- | web/react/components/post_right.jsx | 20 |
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..2c28c5d9f 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 currentUserCss = ""; + if (UserStore.getCurrentId() === this.props.post.user_id) { + currentUserCss = "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 " + currentUserCss}> <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 currentUserCss = ""; + if (UserStore.getCurrentId() === this.props.post.user_id) { + currentUserCss = "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 + " " + currentUserCss}> <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> |