Fuzzy-Searchable Emoji Picker
This commit is contained in:
parent
2f47a3570b
commit
0e9d549cf3
48 changed files with 1697 additions and 280 deletions
28
js/modules/emojis.js
Normal file
28
js/modules/emojis.js
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue