diff options
author | nickago <ngonella@calpoly.edu> | 2015-08-28 08:50:52 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-09-03 09:35:40 -0700 |
commit | c81efd139199f9105178bd52623f887187d49b64 (patch) | |
tree | daffce7433b885f1a9e8ff6856c1dc6732f82088 /web/react/components/rhs_comment.jsx | |
parent | 246a481abc742ffb01c188ed0f5eb4cf9739e3f6 (diff) | |
download | chat-c81efd139199f9105178bd52623f887187d49b64.tar.gz chat-c81efd139199f9105178bd52623f887187d49b64.tar.bz2 chat-c81efd139199f9105178bd52623f887187d49b64.zip |
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; |