Added emoji wrapper with cross platform available gliffs

Этот коммит содержится в:
nickago
2015-08-28 08:50:52 -07:00
родитель 246a481abc
Коммит c81efd1391
6 изменённых файлов: 40 добавлений и 12 удалений

Просмотреть файл

@@ -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);