Fuzzy-Searchable Emoji Picker

This commit is contained in:
Ken Powers 2019-05-24 16:58:27 -07:00 committed by Scott Nonnenberg
parent 2f47a3570b
commit 0e9d549cf3
48 changed files with 1697 additions and 280 deletions

28
js/modules/emojis.js Normal file
View file

@ -0,0 +1,28 @@
const { take } = require('lodash');
const { getRecentEmojis } = require('./data');
const { replaceColons } = require('../../ts/components/emoji/lib');
module.exports = {
getInitialState,
load,
replaceColons,
};
let initialState = null;
async function load() {
const recents = await getRecentEmojisForRedux();
initialState = {
recents: take(recents, 32),
};
}
async function getRecentEmojisForRedux() {
const recent = await getRecentEmojis();
return recent.map(e => e.shortName);
}
function getInitialState() {
return initialState;
}