Don’t sort frequent emojis by default

release
Etienne Lemay 2020-03-16 11:08:13 -04:00
parent 6ca158bb36
commit 56ae7b49c5
No known key found for this signature in database
GPG Key ID: EE7CF89146BB28E9
4 changed files with 4 additions and 26 deletions

View File

@ -289,7 +289,7 @@ export default class NimblePicker extends React.PureComponent {
var component = this.categoryRefs['category-1'] var component = this.categoryRefs['category-1']
if (component) { if (component) {
let maxMargin = component.maxMargin let maxMargin = component.maxMargin
if (!this.props.disableFrequentEmojiSort) { if (this.props.enableFrequentEmojiSort) {
component.forceUpdate() component.forceUpdate()
} }
@ -525,7 +525,6 @@ export default class NimblePicker extends React.PureComponent {
exclude, exclude,
recent, recent,
autoFocus, autoFocus,
disableFrequentEmojiSort,
skinEmoji, skinEmoji,
notFound, notFound,
notFoundEmoji, notFoundEmoji,

View File

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

View File

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

View File

@ -56,6 +56,7 @@ storiesOf('Picker', module)
color={color('Highlight color', '#ae65c5')} color={color('Highlight color', '#ae65c5')}
showPreview={boolean('Show preview', true)} showPreview={boolean('Show preview', true)}
showSkinTones={boolean('Show skin tones', true)} showSkinTones={boolean('Show skin tones', true)}
enableFrequentEmojiSort={boolean('Enable frequent sort', false)}
custom={CUSTOM_EMOJIS} custom={CUSTOM_EMOJIS}
/> />
)) ))
@ -74,28 +75,6 @@ storiesOf('Picker', module)
/> />
)) ))
.add('Pause Frequent Emoji Sort', () => (
<Picker
disableFrequentEmojiSort={boolean('Unicode', true)}
onClick={action('clicked')}
onSelect={action('selected')}
onSkinChange={action('skin changed')}
native={boolean('Unicode', true)}
darkMode={boolean('Dark mode', false)}
set={select('Emoji pack', SETS, SETS[0])}
emojiSize={number('Emoji size', 24)}
perLine={number('Per line', 9)}
title={text('Idle text', 'Your Title Here')}
emoji={text('Idle emoji', 'department_store')}
notFoundEmoji={text('Not found emoji', 'sleuth_or_spy')}
defaultSkin={number('Default skin tone', 1)}
color={color('Highlight color', '#ae65c5')}
showPreview={boolean('Show preview', true)}
showSkinTones={boolean('Show skin tones', true)}
custom={CUSTOM_EMOJIS}
/>
))
.add('Custom category icons', () => ( .add('Custom category icons', () => (
<Picker <Picker
custom={CUSTOM_EMOJIS} custom={CUSTOM_EMOJIS}