Add support for custom emojis to <Emoji />

nolan/hinaloe-test
Jakob Krigovsky 2017-05-26 09:46:44 +02:00
parent a28f04326a
commit d181379480
1 changed files with 10 additions and 2 deletions

View File

@ -66,11 +66,11 @@ export default class Emoji extends React.Component {
render() {
var { set, size, sheetSize, native, forceSize, onOver, onLeave, backgroundImageFn } = this.props,
{ unified } = this.getData(),
{ unified, custom, imageUrl } = this.getData(),
style = {},
children = this.props.children
if (!unified) {
if (!unified && !custom) {
return null
}
@ -83,6 +83,14 @@ export default class Emoji extends React.Component {
style.width = size
style.height = size
}
} else if (custom) {
style = {
width: size,
height: size,
display: 'inline-block',
backgroundImage: `url(${imageUrl})`,
backgroundSize: '100%'
}
} else {
style = {
width: size,