Merge pull request #417 from SaraRandolph/sara.randolph/enhancement/disable_frequent_emoji_sort

enhancement: functionality to disable the frequent emoji sorting
dependabot/npm_and_yarn/websocket-extensions-0.1.4
Etienne Lemay 2020-03-16 11:11:54 -04:00 committed by GitHub
commit b8fad36c6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 1 deletions

View File

@ -289,7 +289,9 @@ export default class NimblePicker extends React.PureComponent {
var component = this.categoryRefs['category-1']
if (component) {
let maxMargin = component.maxMargin
component.forceUpdate()
if (this.props.enableFrequentEmojiSort) {
component.forceUpdate()
}
requestAnimationFrame(() => {
if (!this.scroll) return

View File

@ -37,6 +37,7 @@ const PickerDefaultProps = {
),
emojiTooltip: EmojiDefaultProps.tooltip,
autoFocus: false,
enableFrequentEmojiSort: false,
custom: [],
skinEmoji: '',
notFound: () => {},

View File

@ -43,6 +43,7 @@ const PickerPropTypes = {
exclude: PropTypes.arrayOf(PropTypes.string),
recent: PropTypes.arrayOf(PropTypes.string),
autoFocus: PropTypes.bool,
enableFrequentEmojiSort: PropTypes.bool,
custom: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string.isRequired,

View File

@ -56,6 +56,7 @@ storiesOf('Picker', module)
color={color('Highlight color', '#ae65c5')}
showPreview={boolean('Show preview', true)}
showSkinTones={boolean('Show skin tones', true)}
enableFrequentEmojiSort={boolean('Enable frequent sort', false)}
custom={CUSTOM_EMOJIS}
/>
))