Add support for custom emojis to <Emoji />
parent
a28f04326a
commit
d181379480
|
@ -66,11 +66,11 @@ export default class Emoji extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
var { set, size, sheetSize, native, forceSize, onOver, onLeave, backgroundImageFn } = this.props,
|
var { set, size, sheetSize, native, forceSize, onOver, onLeave, backgroundImageFn } = this.props,
|
||||||
{ unified } = this.getData(),
|
{ unified, custom, imageUrl } = this.getData(),
|
||||||
style = {},
|
style = {},
|
||||||
children = this.props.children
|
children = this.props.children
|
||||||
|
|
||||||
if (!unified) {
|
if (!unified && !custom) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,14 @@ export default class Emoji extends React.Component {
|
||||||
style.width = size
|
style.width = size
|
||||||
style.height = size
|
style.height = size
|
||||||
}
|
}
|
||||||
|
} else if (custom) {
|
||||||
|
style = {
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
|
display: 'inline-block',
|
||||||
|
backgroundImage: `url(${imageUrl})`,
|
||||||
|
backgroundSize: '100%'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
style = {
|
style = {
|
||||||
width: size,
|
width: size,
|
||||||
|
|
Loading…
Reference in New Issue