summaryrefslogtreecommitdiffstats
path: root/web/react/components/post.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-02 11:16:22 -0800
committerCorey Hulen <corey@hulen.com>2015-07-02 11:16:22 -0800
commita3db8e83f68f4341b473e77986dc7ca93f97c2d0 (patch)
treef2d5178c4555acd1f231bdf50d4fc25312d8a519 /web/react/components/post.jsx
parente233d0d2d20bcb12540e39829a2bce754caa185c (diff)
parent97c112c42707f92279b8a85f1f0ad8517fa59f18 (diff)
downloadchat-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.jsx')
-rw-r--r--web/react/components/post.jsx18
1 files changed, 12 insertions, 6 deletions
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index afe978495..04b5ba082 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -6,13 +6,14 @@ var PostBody = require('./post_body.jsx');
var PostInfo = require('./post_info.jsx');
var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
var Constants = require('../utils/constants.jsx');
+var UserStore = require('../stores/user_store.jsx');
var ActionTypes = Constants.ActionTypes;
module.exports = React.createClass({
componentDidMount: function() {
- $('.edit-modal').on('show.bs.modal', function () {
- $('.edit-modal .edit-modal-body').css('overflow-y', 'auto');
- $('.edit-modal .edit-modal-body').css('max-height', $(window).height() * 0.7);
+ $('.modal').on('show.bs.modal', function () {
+ $('.modal-body').css('overflow-y', 'auto');
+ $('.modal-body').css('max-height', $(window).height() * 0.7);
});
},
handleCommentClick: function(e) {
@@ -56,7 +57,7 @@ module.exports = React.createClass({
var error = this.state.error ? <div className='form-group has-error'><label className='control-label'>{ this.state.error }</label></div> : null;
- if(this.props.sameRoot){
+ if (this.props.sameRoot){
rootUser = "same--root";
}
else {
@@ -64,13 +65,18 @@ module.exports = React.createClass({
}
var postType = "";
- if(type != "Post"){
+ if (type != "Post"){
postType = "post--comment";
}
+ var currentUserCss = "";
+ if (UserStore.getCurrentId() === post.user_id) {
+ currentUserCss = "current--user";
+ }
+
return (
<div>
- <div id={post.id} className={"post " + this.props.sameUser + " " + rootUser + " " + postType}>
+ <div id={post.id} className={"post " + this.props.sameUser + " " + rootUser + " " + postType + " " + currentUserCss}>
{ !this.props.hideProfilePic ?
<div className="post-profile-img__container">
<img className="post-profile-img" src={"/api/v1/users/" + post.user_id + "/image"} height="36" width="36" />