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", "prepublishOnly": "npm run build",
"storybook": "start-storybook -p 6006", "storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook", "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": [ "size-limit": [
{ {

View File

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

View File

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