Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: functionality to disable the frequent emoji sorting #417

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/picker/nimble-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/utils/shared-default-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const PickerDefaultProps = {
),
emojiTooltip: EmojiDefaultProps.tooltip,
autoFocus: false,
enableFrequentEmojiSort: false,
custom: [],
skinEmoji: '',
notFound: () => {},
Expand Down
1 change: 1 addition & 0 deletions src/utils/shared-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
))
Expand Down