summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_body.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-08-28 08:50:52 -0700
committernickago <ngonella@calpoly.edu>2015-09-03 09:35:40 -0700
commitc81efd139199f9105178bd52623f887187d49b64 (patch)
treedaffce7433b885f1a9e8ff6856c1dc6732f82088 /web/react/components/post_body.jsx
parent246a481abc742ffb01c188ed0f5eb4cf9739e3f6 (diff)
downloadchat-c81efd139199f9105178bd52623f887187d49b64.tar.gz
chat-c81efd139199f9105178bd52623f887187d49b64.tar.bz2
chat-c81efd139199f9105178bd52623f887187d49b64.zip
Added emoji wrapper with cross platform available gliffs
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r--web/react/components/post_body.jsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index 88fb9aec8..d9b8f20ce 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -5,14 +5,26 @@ const FileAttachmentList = require('./file_attachment_list.jsx');
const UserStore = require('../stores/user_store.jsx');
const Utils = require('../utils/utils.jsx');
const Constants = require('../utils/constants.jsx');
+const twemoji = require('twemoji');
export default class PostBody extends React.Component {
constructor(props) {
super(props);
+ this.parseEmojis = this.parseEmojis.bind(this);
+
const linkData = Utils.extractLinks(this.props.post.message);
this.state = {links: linkData.links, message: linkData.text};
}
+ parseEmojis() {
+ twemoji.parse(React.findDOMNode(this), {size: Constants.EMOJI_SIZE});
+ }
+ componentDidMount() {
+ this.parseEmojis();
+ }
+ componentDidUpdate() {
+ this.parseEmojis();
+ }
componentWillReceiveProps(nextProps) {
const linkData = Utils.extractLinks(nextProps.post.message);
this.setState({links: linkData.links, message: linkData.text});