Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update emoji button #1

Merged
merged 2 commits into from
Jun 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ export default class App extends Component {

##### show

_Required Type:_ boolean
_Required Type:_ `boolean`

Showing emoji picker state.

##### selector

_Required Type:_ function
_Required Type:_ `function`

Change emoji picker showing state.

##### handleEmoji

_Required Type:_ function
_Required Type:_ `function`

Handle input text and emoji.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-simple-emoji",
"version": "0.0.5",
"version": "0.1.0",
"description": "Simple emoji picker.",
"main": "dist/react-emoji-picker.js",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"babel": "inherit"
},
"author": "Peng Jie <dean.leehom@gmail.com> (https://github.com/neighborhood999)",
"repository": {
"repository": {
"type": "git",
"url": "https://github.com/neighborhood999/react-simple-emoji.git"
},
Expand Down
2 changes: 2 additions & 0 deletions src/emojiButtonImage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { Component, PropTypes } from 'react';
import getEmoji from 'get-emoji';
import { emojis, categoryOfEmoji } from './emoji';
import emojiButtonImage from './emojiButtonImage';

const selectorStyle = {
boxShadow: '0 10px 10px 0 rgba(0, 0, 0, 0.20)',
Expand Down Expand Up @@ -93,8 +94,8 @@ export default class EmojiPicker extends Component {
const filterEmojiResult = this.state.filterEmojiResult;

return (
<div>
<button type="button" onClick={() => selector()}>Emoji</button>
<span>
<img role="presentation" src={emojiButtonImage} onClick={() => selector()} />
<div style={show ? selectorStyle : { display: 'none' }}>
<input
ref={(ref) => this.myTextInput = ref}
Expand All @@ -113,7 +114,7 @@ export default class EmojiPicker extends Component {
this.renderAllEmoji(categoryOfEmoji, handleEmoji)
}
</div>
</div>
</span>
);
}
}
9 changes: 5 additions & 4 deletions webpack.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ },
{ test: /\.json$/, loader: 'json', exclude: /node_modules/ },
],
loaders: [{
test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/,
}, {
test: /\.json$/, loader: 'json', exclude: /node_modules/,
}],
},
output: {
library: 'reactEmojiPicker',
Expand Down