Merge pull request #417 from SaraRandolph/sara.randolph/enhancement/disable_frequent_emoji_sort
enhancement: functionality to disable the frequent emoji sortingrelease
commit
b8fad36c6d
|
@ -289,7 +289,9 @@ 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
|
||||||
component.forceUpdate()
|
if (this.props.enableFrequentEmojiSort) {
|
||||||
|
component.forceUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (!this.scroll) return
|
if (!this.scroll) return
|
||||||
|
|
|
@ -37,6 +37,7 @@ const PickerDefaultProps = {
|
||||||
),
|
),
|
||||||
emojiTooltip: EmojiDefaultProps.tooltip,
|
emojiTooltip: EmojiDefaultProps.tooltip,
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
|
enableFrequentEmojiSort: false,
|
||||||
custom: [],
|
custom: [],
|
||||||
skinEmoji: '',
|
skinEmoji: '',
|
||||||
notFound: () => {},
|
notFound: () => {},
|
||||||
|
|
|
@ -43,6 +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,
|
||||||
|
enableFrequentEmojiSort: PropTypes.bool,
|
||||||
custom: PropTypes.arrayOf(
|
custom: PropTypes.arrayOf(
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -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}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue