Added emoji wrapper with cross platform available gliffs
Этот коммит содержится в:
@@ -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;
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user