release
Etienne Lemay 2018-01-09 15:20:18 -05:00
parent 94fc19491a
commit 68a4711658
4 changed files with 14 additions and 12 deletions

View File

@ -35,9 +35,11 @@ describe('Picker', () => {
})
it('maintains category ids after it is filtered', () => {
subject = render({emojisToShowFilter: emoji => true});
const categoriesWithIds = subject.categories.filter(category => category.id);
expect(categoriesWithIds.length).toEqual(10);
});
subject = render({ emojisToShowFilter: emoji => true })
const categoriesWithIds = subject.categories.filter(
category => category.id
)
expect(categoriesWithIds.length).toEqual(10)
})
})
})

View File

@ -53,11 +53,11 @@ const _handleLeave = (e, props) => {
onLeave(emoji, e)
}
const _isNumeric = (value) => {
const _isNumeric = value => {
return !isNaN(value - parseFloat(value))
}
const _convertStyleToCSS = (style) => {
const _convertStyleToCSS = style => {
let div = document.createElement('div')
for (let key in style) {
@ -145,7 +145,9 @@ const Emoji = props => {
if (props.html) {
style = _convertStyleToCSS(style)
return `<span style='${style}' ${title ? `title='${title}'` : ''} class='${className}'>${children || ''}</span>`
return `<span style='${style}' ${title
? `title='${title}'`
: ''} class='${className}'>${children || ''}</span>`
} else {
return (
<span
@ -197,7 +199,7 @@ Emoji.defaultProps = {
onOver: () => {},
onLeave: () => {},
onClick: () => {},
fallback: (emoji) => {},
fallback: emoji => {},
}
export default Emoji

View File

@ -108,7 +108,7 @@ export default class Picker extends React.PureComponent {
let newCategory = {
emojis: newEmojis,
name: category.name,
id: category.id
id: category.id,
}
this.categories.push(newCategory)

View File

@ -151,9 +151,7 @@ function search(
if (results) {
if (emojisToShowFilter) {
results = results.filter(result =>
emojisToShowFilter(pool[result.id])
)
results = results.filter(result => emojisToShowFilter(pool[result.id]))
}
if (results && results.length > maxResults) {