Permalink
Browse files

emoji plugin

  • Loading branch information...
juliankrispel committed Jun 17, 2017
1 parent 937bd5b commit 934e413d57a89f5ec049872b2a33af854f38e4e2
Showing with 121 additions and 20 deletions.
  1. +3 −1 package.json
  2. +14 −4 src/App.js
  3. +104 −15 yarn.lock
View
@@ -3,7 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"draft-js-plugins-editor": "^2.0.0-beta1",
"draft-js": "^0.10.1",
"draft-js-emoji-plugin": "2.0.0-rc2",
"draft-js-plugins-editor": "2.0.0-rc2",
"react": "^15.6.1",
"react-dom": "^15.6.1"
},
View
@@ -1,6 +1,12 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
import Editor from 'draft-js-plugins-editor';
import createEmojiPlugin from 'draft-js-emoji-plugin';
import 'draft-js-emoji-plugin/lib/plugin.css'
const emojiPlugin = createEmojiPlugin();
const { EmojiSuggestions } = emojiPlugin;
class App extends Component {
constructor(props) {
@@ -18,10 +24,14 @@ class App extends Component {
render() {
return (
<Editor
editorState={this.state.editorState}
onChange={this.onChange}
/>
<div>
<Editor
editorState={this.state.editorState}
onChange={this.onChange}
plugins={[emojiPlugin]}
/>
<EmojiSuggestions />
</div>
);
}
}
View
119 yarn.lock

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 934e413

Please sign in to comment.