Use isShortName function
This commit is contained in:

committed by
Scott Nonnenberg

parent
a0e892bf12
commit
67660e1e39
@@ -112,10 +112,6 @@ export const dataByCategory = mapValues(
|
|||||||
arr => sortBy(arr, 'sort_order')
|
arr => sortBy(arr, 'sort_order')
|
||||||
);
|
);
|
||||||
|
|
||||||
export function isShortNameValid(shortName: string) {
|
|
||||||
return Boolean(dataByShortName[shortName]);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSheetCoordinates(
|
export function getSheetCoordinates(
|
||||||
shortName: keyof typeof dataByShortName,
|
shortName: keyof typeof dataByShortName,
|
||||||
skinTone?: SkinToneKey | number
|
skinTone?: SkinToneKey | number
|
||||||
|
@@ -5,12 +5,12 @@ import { mapDispatchToProps } from '../actions';
|
|||||||
import { EmojiButton, Props } from '../../components/emoji/EmojiButton';
|
import { EmojiButton, Props } from '../../components/emoji/EmojiButton';
|
||||||
import { StateType } from '../reducer';
|
import { StateType } from '../reducer';
|
||||||
|
|
||||||
import { isShortNameValid } from '../../components/emoji/lib';
|
import { isShortName } from '../../components/emoji/lib';
|
||||||
import { getIntl } from '../selectors/user';
|
import { getIntl } from '../selectors/user';
|
||||||
|
|
||||||
const selectRecentEmojis = createSelector(
|
const selectRecentEmojis = createSelector(
|
||||||
({ emojis }: StateType) => emojis.recents,
|
({ emojis }: StateType) => emojis.recents,
|
||||||
recents => recents.filter(isShortNameValid)
|
recents => recents.filter(isShortName)
|
||||||
);
|
);
|
||||||
|
|
||||||
const mapStateToProps = (state: StateType) => {
|
const mapStateToProps = (state: StateType) => {
|
||||||
|
Reference in New Issue
Block a user