How to use the emojibase-data/en/data.json.map function in emojibase-data

To help you get started, we’ve selected a few emojibase-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vanilla / vanilla / plugins / rich-editor / src / scripts / Editor / EmojiPopover.jsx View on Github external
import { log } from "@core/utility";
import EmojiButton from "./EmojiButton";
import * as Icons from "./Icons";
import Popover from "./Generic/Popover";
import { withEditor, editorContextTypes } from "./ContextProvider";

const buttonSize = 39;
const colSize = 7;
const rowSize = 7;
const rowIndexesByGroupId = {};
const cellIndexesByGroupId = {};

/**
 * Get start positions for each category
 */
emojis.map((data, key) => {
    const groupID = data.group;
    if (!(groupID in rowIndexesByGroupId)) {
        rowIndexesByGroupId[groupID] = Math.floor(key / colSize);
        cellIndexesByGroupId[groupID] = key;
    }
});

log("rowIndexesByGroupId: ", rowIndexesByGroupId);

export class EmojiPopover extends React.PureComponent {
    static propTypes = {
        ...editorContextTypes,
        isVisible: PropTypes.bool.isRequired,
        closeMenu: PropTypes.func.isRequired,
        blurHandler: PropTypes.func.isRequired,
        popoverTitleID: PropTypes.string.isRequired,