Skip to content

Commit

Permalink
Signify custom emoji elements with class [Ref #117]
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Sep 29, 2017
1 parent 922ae30 commit 1a2d400
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ const Emoji = (props) => {

var { unified, custom, imageUrl } = _getData(props),
style = {},
children = props.children
children = props.children,
className = 'emoji-mart-emoji'

if (!unified && !custom) {
return null
}

if (props.native && unified) {
className += ' emoji-mart-emoji-native'
style = { fontSize: props.size }
children = unifiedToNative(unified)

Expand All @@ -72,6 +74,7 @@ const Emoji = (props) => {
style.height = props.size
}
} else if (custom) {
className += ' emoji-mart-emoji-custom'
style = {
width: props.size,
height: props.size,
Expand Down Expand Up @@ -101,7 +104,7 @@ const Emoji = (props) => {
onClick={(e) => _handleClick(e, props)}
onMouseEnter={(e) => _handleOver(e, props)}
onMouseLeave={(e) => _handleLeave(e, props)}
className='emoji-mart-emoji'>
className={className}>
<span style={style}>{children}</span>
</span>
}
Expand Down

0 comments on commit 1a2d400

Please sign in to comment.