Code Monkey home page Code Monkey logo

emoji-picker-react's Introduction

Emoji Picker React (v4) | Live Demo

Picker

Usage as a Reactions Picker

image

reactions

If you enjoy using emoji-picker-react
You should also consider trying:
Vest validation framework.


What to know before using

  • This package assumes it runs in the browser. I have taken many steps to prevent it from failing on the server, but still, it is recommended to only render the component on the client. See troubleshooting section for more information.

Installation

npm install emoji-picker-react

Usage

import EmojiPicker from 'emoji-picker-react';

function App() {
  return (
    <div>
      <EmojiPicker />
    </div>
  );
}

Shout Outs

Component Design 🎨
317751726_1277528579755086_5320360926126813336_n copy
Pavel Bolo

Features

  • Custom click handler
  • Custom Emojis Support
  • Dark mode
  • Customizable styles via css variables
  • Default skin tone selection
  • Skin tone change
  • Different emoji sets (Google, Apple, Facebook, Twitter)
  • Native Emoji support
  • Emoji Component To Render Emojis in your app
  • Reactions Picker

Props

The following props are accepted by them picker:

Prop Type Default Description
open boolean true Controls whether the picker is open or not.
onEmojiClick function Callback function that is called when an emoji is clicked. The function receives the emoji object as a parameter.
autoFocusSearch boolean true Controls the auto focus of the search input.
Theme string light Controls the theme of the picker. Possible values are light, dark and auto.
emojiStyle string apple Controls the emoji style. Possible values are google, apple, facebook, twitter and native.
defaultSkinTone string neutral Controls the default skin tone.
lazyLoadEmojis boolean false Controls whether the emojis are loaded lazily or not.
previewConfig object {} Controls the preview of the emoji. See below for more information.
searchPlaceholder string Search Controls the placeholder of the search input.
suggestedEmojisMode string frequent Controls the suggested emojis mode. Possible values are frequent and recent.
skinTonesDisabled boolean false Controls whether the skin tones are disabled or not.
searchDisabled boolean false Controls whether the search is disabled or not. When disabled, the skin tone picker will be shown in the preview component.
skinTonePickerLocation string SEARCH Controls the location of the skin tone picker. Possible values are SEARCH and PREVIEW.
emojiVersion string - Allows displaying emojis up to a certain version for compatibility.
className string - Adds a class name to the root element of the picker.
width number/string 350 Controls the width of the picker. You can provide a number that will be treated as pixel size, or your any accepted css width as string.
height number/string 450 Controls the height of the picker. You can provide a number that will be treated as pixel size, or your any accepted css height as string.
style React.CSSProperties {} Adds inline style to the root element of the picker.
getEmojiUrl Function - Allows to customize the emoji url and provide your own image host.
categories Array - Allows full config over ordering, naming and display of categories.
customEmojis Array<{names: string[], imgUrl: string, id: string}> - Allows adding custom emojis to the picker.
reactionsDefaultOpen boolean false Controls whether the reactions picker is on the initial mount instead of the main picker component.
reactions string[] - Controls the reactions to display in the reactions picker. Takes unified emoji ids
onReactionClick Function - Callback function that is called when a reaction is clicked. The function receives the emoji object as a parameter. If not passed, onEmojiClicked is used.
allowExpandReactions boolean true Controls whether the reactions picker can be expanded to the main picker.
onSkinToneChange Function - Callback function that is called when a skin tone is changed. The function receives new picked skin tone as a parameter.

Full details

  • onEmojiClick: (emojiData: EmojiClickData, event: MouseEvent) => void - Callback function when an emoji is clicked. The callback receives the event and the emoji data. The emoji data is comprised of the following properties:

    {
      activeSkinTone: SkinTones;
      unified: string;
      unifiedWithoutSkinTone: string;
      emoji: string; // the emoji character, for example: '😀'. Emoji ID in custom emojis
      isCustom: boolean; // whether the emoji is a custom emoji or not
      names: string[];
      imageUrl: string; // the url of the emoji image with the current emoji style applied
      getImageUrl: (emojiStyle: EmojiStyle) => string; // a function that receives an emoji style and returns the url of the emoji image with the provided style applied
    }
  • theme: Theme - The theme of the picker. Can be light, dark or auto. Default is light. The Theme enum can be imported from the package.

    import { Theme } from 'emoji-picker-react';
  • emojiStyle: EmojiStyle - The emoji style to use. Can be either apple, google, facebook, twitter or native. Default is apple. The EmojiStyle enum can be imported from the package.

    import { EmojiStyle } from 'emoji-picker-react';
  • autoFocusSearch: boolean - Whether to focus the search input on mount. Defaults to true.

  • lazyLoadEmojis: boolean - Whether to lazy load the emojis. Defaults to false.

  • defaultSkinTone: SkinTones - The default skin tone to use when an emoji is clicked. Defaults to SkinTones.Neutral. Possible skin tones are:

    • ✋ 'neutral'
    • ✋🏻 '1f3fb'
    • ✋🏼 '1f3fc'
    • ✋🏽 '1f3fd'
    • ✋🏾 '1f3fe'
    • ✋🏿 '1f3ff'

The skin tones typescript enum can be imported directly from the package:

import { SkinTones } from 'emoji-picker-react';
  • onSkinToneChange: (skinTone: SkinTones) => void - Callback function when a skin tone is changed.

  • searchDisabled: boolean - Whether to disable the search input. Defaults to false. When disabled, the skin tone picker will be shown in the preview component.

  • skinTonesDisabled: boolean - Whether to disable the skin tone selection. Defaults to false.

  • skinTonePickerLocation: SkinTonePickerLocation - The location of the skin tone picker. Can be either SEARCH or PREVIEW. Defaults to SEARCH. The SkinTonePickerLocation enum can be imported from the package.

    import { SkinTonePickerLocation } from 'emoji-picker-react';
  • previewConfig: PreviewConfig - Full control over the Preview component, either to show/hide it, change the default emoji or the default caption.

{
  defaultEmoji: string; // defaults to: "1f60a"
  defaultCaption: string; // defaults to: "What's your mood?"
  showPreview: boolean; // defaults to: true
}
  • searchPlaceholder: string - The placeholder text for the search input. Defaults to Search.

  • categories: Allows full config over ordering, naming and display of categories. To only sort/omit categories, you can simply pass an array of category names to display:

    • 'suggested',
    • 'custom', - Hidden by default
    • 'smileys_people',
    • 'animals_nature',
    • 'food_drink',
    • 'travel_places',
    • 'activities',
    • 'objects',
    • 'symbols',
    • 'flags'

    For a more in-depth configuration, you can pass an array with category config:

    [
      {
        category: 'suggested',
        name: 'Recently Used'
      },
      {
        category: 'smileys_people',
        name: 'Faces...'
      }
    ];
  • suggestedEmojisMode: SuggestedEmojisMode - The mode to use for the suggested emojis. Can be either recent or frequent. Defaults to recent. The SuggestionMode enum can be imported from the package.

    import { SuggestionMode } from 'emoji-picker-react';
  • emojiVersion: string - Allows displaying emojis up to a certain version for compatibility. The passed version will be parsed as a float and each emoji will be tested against it. Common values are:

    • "0.6"
    • "1.0"
    • "2.0"
    • "3.0"
    • "4.0"
    • "5.0"
  • getEmojiUrl: (unified: string, emojiStyle: EmojiStyle) => string - Allows to customize the emoji url and provide your own image host. The function receives the emoji unified and the emoji style as parameters. The function should return the url of the emoji image.

Custom Emojis

The customEmojis prop allows you to add custom emojis to the picker. The custom emojis prop takes an array of custom emojis, each custom emoji has three keys:

id: Unique identifier for each of the custom emojis names: an array of string identifiers, will be used both for display, search and indexing. imgUrl: URL for the emoji image

Usage Example

<Picker
  customEmojis={[
    {
      names: ['Alice', 'alice in wonderland'],
      imgUrl:
        'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/alice.png',
      id: 'alice'
    },
    {
      names: ['Dog'],
      imgUrl:
        'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/dog.png',
      id: 'dog'
    },
    {
      names: ['Hat'],
      imgUrl:
        'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/hat.png',
      id: 'hat'
    },
    {
      names: ['Vest'],
      imgUrl:
        'https://cdn.jsdelivr.net/gh/ealush/emoji-picker-react@custom_emojis_assets/vest.png',
      id: 'vest'
    }
  ]}
/>

Here are some additional things to keep in mind about custom emojis:

  • The custom emojis will be added to the Custom category.
  • The location or name of the Custom category can be controlled via the categories prop.
  • The custom emojis will be indexed by their id property. This means that you can search for custom emojis by their id or names.

Reactions Picker

image

reactions

The picker can be used as a reactions picker. To use it as a reactions picker, you should set the reactionsDefaultOpen prop to true. This will cause the picker to the reactions picker on the initial mount instead of the main picker component.

To customize the reactions, you should pass an array of unified emoji ids to the reactions prop.

The reactions picker uses the same event handlers, and the same css variables for customizations.

<Picker reactionsDefaultOpen={true} onReactionClick={handleReaction} />

Customization

Custom Picker Width and Height

To customize the dimensions of the picker, use the height and width props. You can pass in a number that will be treated as pixel size, or your any accepted css width/height as string.

<EmojiPicker height={500} width={400} />
<EmojiPicker height="100%" width="15em" />

CSS Variables

The picker can be customized via css variables. The root selector for the picker is .EmojiPickerReact, when overriding, make sure to provide a more specific selector.

In dark mode, the specific selector is .EmojiPickerReact.epr-dark-theme.

The list of possible variables is quite extensive, but the main ones you may want to override are:

  • --epr-emoji-size: The size of the emojis.

  • --epr-emoji-gap: The space between emojis.

  • --epr-hover-bg-color Hovered emoji background color.

  • --epr-bg-color: The background color of the picker. When changing it, you should also change --epr-category-label-bg-color as they are usually the same color.

  • --epr-text-color: The text color in the picker.

Rendering Output Emojis in Your App

The picker exports an Emoji component. The emoji component is the same used within the picker, so it will render the same way as the emojis in the picker. You can choose to render emojis either as native, or as images.

Props

Name Type Default Description
unified string "" The unified code of the emoji.
size number 32 The size of the emoji.
emojiStyle EmojiStyle EmojiStyle.APPLE The emoji style to use. Can be either apple, google, facebook, twitter or native.
lazyLoad boolean false Whether to lazy load the emoji. image
emojiUrl string - The url of the emoji image to render. Useful for custom emojis.
getEmojiUrl Function - Allows to customize the emoji url and provide your own image host for dynamic resolution.
import { Emoji, EmojiStyle } from 'emoji-picker-react';

export function MyApp() {
  return (
    <p>
      My Favorite emoji is:
      <Emoji unified="1f423" size="25" />
    </p>
  );
}

How to Contribute?

Check out the contributing documentation to get information about contributing, reporting bugs, suggesting enhancements, and writing code changes to the project!

Troubleshooting

Error Boundary

emoji-picker-react has a top-level error boundary, trying to catch rendering errors. It won't catch server side related errors, or event handlers errors. If an error is caught, the picker will not render, and a console error will be logged.

Next.js

To avoid errors such as "document is not defined" on the server side, you should make sure the library is only imported on the client side. Here is how to do that:

import dynamic from 'next/dynamic';

const Picker = dynamic(
  () => {
    return import('emoji-picker-react');
  },
  { ssr: false }
);

Vite

For reference, if you only need to shim global, you can add

<script>
  window.global = window;
</script>

emoji-picker-react's People

Contributors

amotarao avatar cateiru avatar centrual avatar dependabot[bot] avatar dominiczeq7 avatar ealush avatar erdemgonul avatar erezbiren avatar greenkeeper[bot] avatar iamthe-wraith avatar indutny-signal avatar jacklee814 avatar jjsearle avatar lamperoyge avatar lior-a avatar lleyton avatar mateki0 avatar mcapodici avatar nafaska avatar nati-elmaliach avatar ry4n1m3 avatar scharascher avatar spencer17x avatar syedzubairahmed001 avatar talisraeli avatar tantany avatar thenumberone avatar thiltunen avatar ymatsakova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

emoji-picker-react's Issues

An in-range update of enzyme is breaking the build 🚨

There have been updates to the enzyme monorepo:

    • The devDependency enzyme was updated from 3.9.0 to 3.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.

enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

style={{}} doesnt work

Why can i not add a style with that:
<Picker style={{width: 500}} onEmojiClick={this.onEmojiClick} />

An in-range update of eslint-plugin-react is breaking the build 🚨

The devDependency eslint-plugin-react was updated from 7.13.0 to 7.14.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v7.14.0

Added

Fixed

  • Fix no-did-mount-set-state and no-did-update-set-state to handle cDU and cDM defined as class properties (#1595 @jaaberg)
  • Fix sort-prop-types cash when a shape PropType is defined in a variable (#1749 @alexzherdev)
  • Fix no-unused-state false positive when using state of non-lifecycle method (#2274 @golopot)
  • Fix static-property-placement false positive when accessing static property inside method (#2283 @dmason30)
  • Fix prop-type detection for annotated props with default value (#2298 @yannickcr)

Changed

Commits

The new version differs by 68 commits.

  • dfaa92f Update CHANGELOG and bump version
  • c52b61b Merge pull request #2316 from kaykayehnn/jsx-key-fragments
  • 8db631b [Fix] Fix detection of annotated props with default value
  • bbebefd [Tests] Remove AppVeyor
  • 0d49f5a [New] Add ESLint ^6.0.0 as valid peerDependency
  • 0364ed2 Fix formatting issues
  • 7c1abed Add checkFragmentShorthand option
  • ed04c2f Fix tests in eslint < 5
  • 0d1aaf8 Handle fragments in jsx-key
  • 7d449a9 [New] jsx-sort-props: Change reported range to only the identifier
  • 1e102f0 Change reported range to only the identifier
  • e6b4c33 Merge pull request #2301 from golopot/fix-cached-props-2
  • 9a63e19 Immediately destructure out propVariables rather than using it as a namespace
  • 3a1a0d1 Apply suggestion: replace mutation with Object.assign
  • 89b8143 Apply suggestion: replace concat([a]) with concat(a)

There are 68 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-react is breaking the build 🚨

The devDependency eslint-plugin-react was updated from 7.12.4 to 7.13.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 74 commits.

  • f39829f Update CHANGELOG and bump version
  • 9e81dde [Deps] update jsx-ast-utils, resolve
  • e73a692 Merge pull request #2256 from mateuszsokola/master
  • b5fc9bf [fix] jsx-props-no-multi-spaces: support generic components (ts)
  • 8bd3837 Fix Node 4 compatibility
  • 005dad3 Revert "Replace mocha by jest"
  • 6e4f43e Replace mocha by jest
  • 09f580c Replace typescript-eslint-parser by @typescript-eslint/parser
  • 861fdef [fix] prop-types: fix case with destructuring and defualt param
  • 9fbd037 Fix ESLint 6 compat by providing parser as absolute path to RuleTester
  • 8041075 Fix jsx-curly-brace-presence schema defaults
  • 9cec705 Add next ESLint version to Travis
  • 0d4725e Add Node 12 and remove Node 4/6 from Travis
  • 9192ec3 Update devDependencies
  • d5d2e82 Merge pull request #2250 from guliashvili/master

There are 74 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Emoji not working on windows

Hello @ALL, thanks for the nice package, this package works perfectly on mac os & iOS but it's not working on a windows system, Any help?

document is not defined

document is not defined

const [chosenEmoji, setChosenEmoji] = useState(null);
const [mounted, setMounted] = useState(null);

useEffect(() => setMounted(true), []);

.......

                        {mounted &&

                            <Fragment>

                                <Picker onEmojiClick={(event, emojiObject) => {
                                    setChosenEmoji(emojiObject);
                                }}/>

                                {chosenEmoji.emoji}

                            </Fragment>

                        }

An in-range update of enzyme is breaking the build 🚨

There have been updates to the enzyme monorepo:

    • The devDependency enzyme was updated from 3.9.0 to 3.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.

enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Duplicated emoji

Some of the smiles are duplicated. Is this a bug or a feature?

Make group labels available to internationalization.

Make Emoiji Groups labels properties for internationalization purposes: ["smileys & people","animals & nature","food & drink","travel & places","activities","objects","symbols","flags"]

ex: travelAndPlaces: "Lugares e Viagens"

State is undefined on child component callback

Parent component:

const [value, setValue] = useState();
...
const someAction = () => {
setValue(123)
}

const emojiHandle = () => {
console.log(value) //display undefined
}
...
...
return(
...
<Emoji callback={handleEmojiChange} /> // -> child component :  onEmojiClick={callback}
<button onClick={someAction}>Press me 1st</button>
)

So, problem is that State is undefined on child component callback.
Reproduction:
Press the button to set state.
Then press on any Emojy to execute callback from parent component and display state.
Callback will show undefined state, which you already set when you press the button.

How to get access to state?

Country Flags aren't showing on "chosenEmoji.emoji"

Calling most emojis from its objects work as expected, but it seems like flags from countries only appear as letters, for example, when selecting the flag of "Brazil", the chosenEmoji.emoji from it shows the letters "BR", the same as other country flags;

brflag

Get actual emoji in returned object

Hey! I love the component, but I'm wondering why you can't also add the actual emoji selected and add it to the returned object when you pick the emoji?

Having to render an image from a CDN for every emoji you want to render seems too expensive...

Differences between picker and parser?

I'm using emoji-picker-react together with emoji-js in a project and I want to put the emoji images on a CDN. I am having issues however, since images are missing.

Emoji 🏃 for example. When I inspect the image URL in the picker it is the following URL:

https://cdn.jsdelivr.net/emojione/assets/3.0/png/32/1f3c3.png (which exists)

The parser (emoji-js) however generates the following URL:

https://cdn.jsdelivr.net/emojione/assets/3.0/png/32/1f3c3-200d-2642-fe0f.png (which does not exist)

I am using the following version:

                "emoji-js": "^3.4.1",
                "emoji-picker-react": "^2.1.1",

An in-range update of svg-url-loader is breaking the build 🚨

The devDependency svg-url-loader was updated from 2.3.2 to 2.3.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

svg-url-loader is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 221 commits.

  • 757cd4f 2.3.3
  • a37d5a0 chore: added DS_Store to gitignore
  • c6011d3 Merge pull request #315 from bhovhannes/improvements
  • 90e1bdc test: better jest config
  • 3bab05d test: add Jest configuration
  • 758b647 perf: increase loader performance by avoiding re-parsing regexps
  • 90763c1 test: switched to Jest
  • 71857e7 Merge remote-tracking branch 'origin/master'
  • 39362ca Update .renovaterc
  • 7d22d91 chore(deps): update dependency webpack to v4.34.0
  • 9dab242 Merge pull request #313 from bhovhannes/renovate/css-loader-3.x
  • 8cb755f chore(deps): update dependency css-loader to v3
  • 4b94056 Merge pull request #312 from bhovhannes/renovate/file-loader-4.x
  • bff4e70 fix(deps): update dependency file-loader to v4
  • 35bbcb8 Merge pull request #311 from bhovhannes/renovate/webpack-4.x

There are 221 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Passing a prop to enable/disable autofocus on searchbar?

Hi! I was recently trying the latest version 3.1.6 of the emoji picker and the searchbar has the autofocus enabled by default. IMHO, this should be up to the developer as in some scenarios, e.g., Safari iPhone, the autofocus is handled by auto-zooming in if the font-size is below a specific threshold (I think if lower than 16px). I suggest to have a prop "autofocus" to be set to true or false in order to have more flexibility (maybe it would be interesting to have also a prop for font-sizes, or to enable/disable the search bar).

By the way, is there any workaround at this moment to disable the autofocus on searchbar?

Thanks in advance!

groupNames is not in the props interface

Hello!

I want to use i18n, but the ts shows an error that the groupNames object is not in props

export interface IEmojiPickerProps {
    onEmojiClick: (event: MouseEvent, data: IEmojiData) => void;
    emojiUrl?: string;
    preload?: boolean;
    skinTone?: SkinTones;
    disableAutoFocus?: boolean;
    disableSearchBar?: boolean;
    disableSkinTonePicker?: boolean;
  }

An in-range update of prop-types is breaking the build 🚨

The devDependency prop-types was updated from 15.6.2 to 15.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prop-types is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

on Focus Out

To Improve user experience on some applications, the emoji picker needs to be closed when it loses its focus, it can be an opt in feature though... If this already exist please let me know or i can work on this as well.

An in-range update of enzyme is breaking the build 🚨

There have been updates to the enzyme monorepo:

    • The devDependency enzyme was updated from 3.9.0 to 3.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.

enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of enzyme is breaking the build 🚨

There have been updates to the enzyme monorepo:

    • The devDependency enzyme was updated from 3.9.0 to 3.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.

enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Typescript Declarations

Hello,

I written typescript declaration file for my own project. It can help to people:

emoji-picker-react.d.ts

declare module 'emoji-picker-react' {
  import React from "react";

  export const SKIN_TONE_NEUTRAL = 'neutral';
  export const SKIN_TONE_LIGHT = '1f3fb';
  export const SKIN_TONE_MEDIUM_LIGHT = '1f3fc';
  export const SKIN_TONE_MEDIUM = '1f3fe';
  export const SKIN_TONE_MEDIUM_DARK = '1f3ff';
  export const SKIN_TONE_DARK = '1f3fd';

  export interface IEmojiData {
    unified: string,
    originalUnified: string,
    names: Array<string>,
    emoji: string,
    activeSkinTone: string
  }

  export interface IEmojiPickerProps {
    onEmojiClick: Function,
    emojiUrl?: string,
    preload?: boolean,
    skinTone?: SKIN_TONE_NEUTRAL | SKIN_TONE_LIGHT | SKIN_TONE_MEDIUM_LIGHT | SKIN_TONE_MEDIUM | SKIN_TONE_MEDIUM_DARK | SKIN_TONE_DARK
  }

  const EmojiPicker: React.FC<IEmojiPickerProps> = (props: IEmojiPickerProps) => {};
  export default EmojiPicker;
}

components unmount warning

I know that Loading the Picker needs some time, but if the component unmount during the Picker rendering, I will see this warning in broswer console. Is there any way that I can do when the component is unmount ?
image

An in-range update of enzyme is breaking the build 🚨

There have been updates to the enzyme monorepo:

    • The devDependency enzyme was updated from 3.9.0 to 3.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.

enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

It Crashes on Safari Version 12.0.3

The packages works fine on safari version 13.1 but it crashes on older versions like 12.0.3.
I am attaching a screenshot below for the error i get in the console.

Screenshot 2020-09-17 at 2 16 50 PM

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

Property to add loading inside of picker.

The component itself is really good, but since there are many stickers to load, it takes a time to load the component, it would be awesome to have a property to open the modal with the emojis, but show a Loading while the emojis are loading (not all emojis of course).

something like:

<Picker showLoading={true} />

example

Errors while building the package

Thanks for developing and sharing this awesome package!

I'm trying to use this package using yarn, but while building I get following errors

✖ 「atl」: Checking finished with 9 errors
[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:12:7 
    TS2749: 'SKIN_TONE_NEUTRAL' refers to a value, but is being used as a type here. Did you mean 'typeof SKIN_TONE_NEUTRAL'? 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:13:7 
    TS2749: 'SKIN_TONE_LIGHT' refers to a value, but is being used as a type here. Did you mean 'typeof SKIN_TONE_LIGHT'? 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:14:7 
    TS2749: 'SKIN_TONE_MEDIUM_LIGHT' refers to a value, but is being used as a type here. Did you mean 'typeof SKIN_TONE_MEDIUM_LIGHT'? 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:15:7 
    TS2749: 'SKIN_TONE_MEDIUM' refers to a value, but is being used as a type here. Did you mean 'typeof SKIN_TONE_MEDIUM'? 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:16:7 
    TS2749: 'SKIN_TONE_MEDIUM_DARK' refers to a value, but is being used as a type here. Did you mean 'typeof SKIN_TONE_MEDIUM_DARK'? 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:17:7 
    TS2749: 'SKIN_TONE_DARK' refers to a value, but is being used as a type here. Did you mean 'typeof SKIN_TONE_DARK'? 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:38:9 
    TS2322: Type '(props: IEmojiPickerProps) => void' is not assignable to type 'FC<IEmojiPickerProps>'.
  Type 'void' is not assignable to type 'ReactElement<any, any>'. 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:38:52 
    TS1039: Initializers are not allowed in ambient contexts. 

[at-loader] ./node_modules/emoji-picker-react/emoji-picker-react.d.ts:40:8 
    TS1183: An implementation cannot be declared in ambient contexts. 

How do I solve this? I'm using typescript version 3.9.7, yarn version 1.22.4 and webpack version 3.3.11. Happy to provide more information.

Thank you!
Kuldeep

Reduce Icons By Default

We tried to use the picker but we noticed that the default config is 160px for an emoji picker is too much.

We suggest to use a 16px or 32pxso the file size is reduced onload. That can be the reason why performance is affected.

List react as a dependency

I went to check the impact of adding this as a dependency to my app using bundlephobia. It reported that react was not listed as a dependency or peerDependency so could not complete the request.

image

For something like this I would consider adding react as peerDependency is thing something you are willing to do? I am happy to make a PR if so.

Why UNLICENSED?

I wanted to use this fantastic picker in my project, but I can't because of the license.
There is any reason to be unlicensed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.