Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Dec 15, 2017
1 parent 1119d60 commit e78609b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/components/emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const Emoji = props => {
}

let data = _getData(props)
if (!data) { return null }
if (!data) {
return null
}

let { unified, custom, short_names, imageUrl } = data,
style = {},
Expand Down
11 changes: 9 additions & 2 deletions src/components/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import { deepMerge, measureScrollbar } from '../utils'
import { Anchors, Category, Emoji, Preview, Search } from '.'

const RECENT_CATEGORY = { id: 'recent', name: 'Recent', emojis: null }
const SEARCH_CATEGORY = { id: 'search', name: 'Search', emojis: null, anchor: false }
const SEARCH_CATEGORY = {
id: 'search',
name: 'Search',
emojis: null,
anchor: false,
}
const CUSTOM_CATEGORY = { id: 'custom', name: 'Custom', emojis: [] }

const I18N = {
Expand Down Expand Up @@ -465,7 +470,9 @@ export default class Picker extends React.PureComponent {
i18n={this.i18n}
recent={category.id == RECENT_CATEGORY.id ? recent : undefined}
custom={
category.id == RECENT_CATEGORY.id ? CUSTOM_CATEGORY.emojis : undefined
category.id == RECENT_CATEGORY.id
? CUSTOM_CATEGORY.emojis
: undefined
}
emojiProps={{
native: native,
Expand Down
8 changes: 2 additions & 6 deletions src/utils/emoji-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,9 @@ function search(

data.categories.forEach(category => {
let isIncluded =
include && include.length
? include.indexOf(category.id) > -1
: true
include && include.length ? include.indexOf(category.id) > -1 : true
let isExcluded =
exclude && exclude.length
? exclude.indexOf(category.id) > -1
: false
exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false
if (!isIncluded || isExcluded) {
return
}
Expand Down

0 comments on commit e78609b

Please sign in to comment.