Merge pull request #277 from kayleemann/master

Support case where showPreview is false but showSkinTones is true. Also add prepare script.
nolan/hinaloe-test
Nolan Lawson 2019-03-08 07:32:23 -08:00 committed by GitHub
commit a871cacbf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -76,7 +76,8 @@
"prepublishOnly": "npm run build",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"prettier": "prettier --write \"{src,scripts,spec}/**/*.js\""
"prettier": "prettier --write \"{src,scripts,spec}/**/*.js\"",
"prepare": "npm run build:dist"
},
"size-limit": [
{

View File

@ -566,7 +566,7 @@ export default class NimblePicker extends React.PureComponent {
})}
</div>
{showPreview && (
{(showPreview || showSkinTones) && (
<div className="emoji-mart-bar">
<Preview
ref={this.setPreviewRef}
@ -574,6 +574,7 @@ export default class NimblePicker extends React.PureComponent {
title={title}
emoji={emoji}
showSkinTones={showSkinTones}
showPreview={showPreview}
emojiProps={{
native: native,
size: 38,

View File

@ -23,9 +23,10 @@ export default class Preview extends React.PureComponent {
title,
emoji: idleEmoji,
i18n,
showPreview,
} = this.props
if (emoji) {
if (emoji && showPreview) {
var emojiData = getData(emoji, null, null, this.data),
{ emoticons = [] } = emojiData,
knownEmoticons = [],