diff options
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/post_body.jsx | 7 | ||||
-rw-r--r-- | web/react/components/rhs_root_post.jsx | 8 | ||||
-rw-r--r-- | web/react/utils/emoticons.jsx | 9 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 2 |
4 files changed, 19 insertions, 7 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index de8195f91..27f7ad2de 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -4,6 +4,7 @@ import FileAttachmentList from './file_attachment_list.jsx'; import UserStore from '../stores/user_store.jsx'; import * as Utils from '../utils/utils.jsx'; +import * as Emoji from '../utils/emoticons.jsx'; import Constants from '../utils/constants.jsx'; import * as TextFormatting from '../utils/text_formatting.jsx'; import twemoji from 'twemoji'; @@ -52,7 +53,11 @@ export default class PostBody extends React.Component { } parseEmojis() { - twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE}); + twemoji.parse(ReactDOM.findDOMNode(this), { + className: 'emoji twemoji', + base: '', + folder: Emoji.getImagePathForEmoticon() + }); } componentWillMount() { diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx index 3d3d9e13f..0dd969ad0 100644 --- a/web/react/components/rhs_root_post.jsx +++ b/web/react/components/rhs_root_post.jsx @@ -6,9 +6,9 @@ import UserProfile from './user_profile.jsx'; import UserStore from '../stores/user_store.jsx'; import * as TextFormatting from '../utils/text_formatting.jsx'; import * as utils from '../utils/utils.jsx'; +import * as Emoji from '../utils/emoticons.jsx'; import FileAttachmentList from './file_attachment_list.jsx'; import twemoji from 'twemoji'; -import Constants from '../utils/constants.jsx'; import PostBodyAdditionalContent from './post_body_additional_content.jsx'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; @@ -21,7 +21,11 @@ export default class RhsRootPost extends React.Component { this.state = {}; } parseEmojis() { - twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE}); + twemoji.parse(ReactDOM.findDOMNode(this), { + className: 'emoji twemoji', + base: '', + folder: Emoji.getImagePathForEmoticon() + }); } componentDidMount() { this.parseEmojis(); diff --git a/web/react/utils/emoticons.jsx b/web/react/utils/emoticons.jsx index bb948b6dc..8943e9544 100644 --- a/web/react/utils/emoticons.jsx +++ b/web/react/utils/emoticons.jsx @@ -154,6 +154,9 @@ export function handleEmoticons(text, tokens) { return output; } -function getImagePathForEmoticon(name) { - return `/static/images/emoji/${name}.png`; -} +export function getImagePathForEmoticon(name) { + if (name) { + return `/static/images/emoji/${name}.png`; + } + return `/static/images/emoji`; +}
\ No newline at end of file diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 7cc8a5c97..ab09ea919 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1238,4 +1238,4 @@ export function getPostTerm(post) { export function isFeatureEnabled(feature) { return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label, {value: 'false'}).value === 'true'; -} +}
\ No newline at end of file |