How to use the @airbnb/lunar.initialize function in @airbnb/lunar

To help you get started, we’ve selected a few @airbnb/lunar 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 airbnb / lunar / .storybook / bootstrap.js View on Github external
import 'airbnb-js-shims';
import { stripHexcode } from 'emojibase';
import Lunar from '@airbnb/lunar';
import { THEME } from './constants';

Lunar.initialize({
  name: 'Lunar',
  emojiCDN: (hexcode, large) =>
    `https://cdn.jsdelivr.net/emojione/assets/4.5/png/${large ? 64 : 32}/${stripHexcode(
      hexcode,
    ).toLowerCase()}.png`,
  logger: console.log,
  theme: THEME,
});
github airbnb / lunar / guide / setup.js View on Github external
import Lunar from '@airbnb/lunar';
import moon from './images/moon.jpg';
import stars from './images/stars.jpg';
import lunar from './images/lunar.png';

global.log = (...args) => console.log(...args);
global.debug = key => (...args) => console.log(key, ...args);
global.images = { moon, stars, lunar };

Lunar.initialize({
  emojiCDN: hexcode =>
    `https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.7/assets/png/${hexcode.toLowerCase()}.png`,
  logger: global.log,
});