Pass custom emoji data directly to <Preview />

<Preview /> calls getData() itself which will fail for custom emojis because there is no universally available data source for custom emojis. To work around this, we pass the custom emoji data (which <Picker /> received via the `custom` prop) directly to <Preview />.
nolan/hinaloe-test
Jakob Krigovsky 2017-05-26 10:21:18 +02:00
parent 7ce0f8efba
commit 289fc0ffc0
1 changed files with 2 additions and 1 deletions

View File

@ -152,7 +152,8 @@ export default class Picker extends React.Component {
handleEmojiOver(emoji) {
var { preview } = this.refs
preview.setState({ emoji: emoji })
const emojiData = CUSTOM_CATEGORY.emojis.find(customEmoji => customEmoji.id === emoji.id)
preview.setState({ emoji: Object.assign(emoji, emojiData) })
clearTimeout(this.leaveTimeout)
}