summaryrefslogtreecommitdiffstats
path: root/web/react/components/rhs_root_post.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-09-03 13:37:00 -0700
committerCorey Hulen <corey@hulen.com>2015-09-03 13:37:00 -0700
commitb3fea25eddc332e9529692733093291b10d4aeef (patch)
treed580fdd049876cfafe009462b4050e5794cc2a6e /web/react/components/rhs_root_post.jsx
parent499b9043c5371f97b1dd5b5a1d1970abd0901b32 (diff)
parentc81efd139199f9105178bd52623f887187d49b64 (diff)
downloadchat-b3fea25eddc332e9529692733093291b10d4aeef.tar.gz
chat-b3fea25eddc332e9529692733093291b10d4aeef.tar.bz2
chat-b3fea25eddc332e9529692733093291b10d4aeef.zip
Merge pull request #590 from nickago/MM-1932
MM-1932 Added emoji wrapper with cross platform available gliffs
Diffstat (limited to 'web/react/components/rhs_root_post.jsx')
-rw-r--r--web/react/components/rhs_root_post.jsx14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx
index a407e6470..7c176cedf 100644
--- a/web/react/components/rhs_root_post.jsx
+++ b/web/react/components/rhs_root_post.jsx
@@ -6,12 +6,23 @@ var UserProfile = require('./user_profile.jsx');
var UserStore = require('../stores/user_store.jsx');
var utils = require('../utils/utils.jsx');
var FileAttachmentList = require('./file_attachment_list.jsx');
+var twemoji = require('twemoji');
+var Constants = require('../utils/constants.jsx');
export default class RhsRootPost extends React.Component {
constructor(props) {
super(props);
+
+ this.parseEmojis = this.parseEmojis.bind(this);
+
this.state = {};
}
+ parseEmojis() {
+ twemoji.parse(React.findDOMNode(this), {size: Constants.EMOJI_SIZE});
+ }
+ componentDidMount() {
+ this.parseEmojis();
+ }
shouldComponentUpdate(nextProps) {
if (!utils.areStatesEqual(nextProps.post, this.props.post)) {
return true;
@@ -19,6 +30,9 @@ export default class RhsRootPost extends React.Component {
return false;
}
+ componentDidUpdate() {
+ this.parseEmojis();
+ }
render() {
var post = this.props.post;
var message = utils.textToJsx(post.message);