diff options
author | Corey Hulen <corey@hulen.com> | 2015-09-03 13:37:00 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-09-03 13:37:00 -0700 |
commit | b3fea25eddc332e9529692733093291b10d4aeef (patch) | |
tree | d580fdd049876cfafe009462b4050e5794cc2a6e /web/react/components/rhs_comment.jsx | |
parent | 499b9043c5371f97b1dd5b5a1d1970abd0901b32 (diff) | |
parent | c81efd139199f9105178bd52623f887187d49b64 (diff) | |
download | chat-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_comment.jsx')
-rw-r--r-- | web/react/components/rhs_comment.jsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx index e74ab7f13..997a2b082 100644 --- a/web/react/components/rhs_comment.jsx +++ b/web/react/components/rhs_comment.jsx @@ -12,12 +12,14 @@ var FileAttachmentList = require('./file_attachment_list.jsx'); var Client = require('../utils/client.jsx'); var AsyncClient = require('../utils/async_client.jsx'); var ActionTypes = Constants.ActionTypes; +var twemoji = require('twemoji'); export default class RhsComment extends React.Component { constructor(props) { super(props); this.retryComment = this.retryComment.bind(this); + this.parseEmojis = this.parseEmojis.bind(this); this.state = {}; } @@ -51,6 +53,12 @@ export default class RhsComment extends React.Component { PostStore.updatePendingPost(post); this.forceUpdate(); } + 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; @@ -58,6 +66,9 @@ export default class RhsComment extends React.Component { return false; } + componentDidUpdate() { + this.parseEmojis(); + } render() { var post = this.props.post; |