Skip to content

Commit

Permalink
1.2.14 Add skin tone indication to emojis with skin tones
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Aug 24, 2017
1 parent bb56728 commit 01db0ec
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<body>
<div id="root"></div>
<div id="error-display"></div>
<script src="static/preview.9636572521cda96a1196.bundle.js"></script>
<script src="static/preview.119eb4680620fd473286.bundle.js"></script>
</body>
</html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/preview.119eb4680620fd473286.bundle.js.map

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

1 change: 0 additions & 1 deletion docs/static/preview.9636572521cda96a1196.bundle.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emoji-picker-react",
"version": "1.2.13",
"version": "1.2.14",
"description": "React emoji-picker component",
"main": "./dist/index.js",
"scripts": {
Expand Down
9 changes: 4 additions & 5 deletions src/DiversityPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import emojiAccessor from '../emoji-data/emoji_accessor';
import { bgImage } from '../Emoji/helpers';
import './style.scss';

function DiversityPicker({ name, assetPath, emojiResolution, onEmojiClick, close }) {

const className = `diversity-picker${name ? ' shown' : ''}`,
emoji = emojiAccessor(emojis[name]);
function DiversityPicker({ index, assetPath, emojiResolution, onEmojiClick, close }) {
const className = `diversity-picker${index ? ' shown' : ''}`,
emoji = emojiAccessor(emojis[index]);

let diversities = null;

Expand Down Expand Up @@ -38,7 +37,7 @@ function DiversityPicker({ name, assetPath, emojiResolution, onEmojiClick, close
}

DiversityPicker.propTypes = {
name: PropTypes.string,
index: PropTypes.number,
assetPath: PropTypes.string,
emojiResolution: PropTypes.number,
onEmojiClick: PropTypes.func.isRequired,
Expand Down
5 changes: 3 additions & 2 deletions src/Emoji/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ class Emoji extends Component {

unified = unifiedWithModifier(emoji, activeModifier);

const style = bgImage({ unified, assetPath, emojiResolution });
const style = bgImage({ unified, assetPath, emojiResolution }),
className = `emoji${this.hasDiversities ? ' has-diversities' : ''}`;
style.order = emoji.order;

return (
<a href="#!"
className="emoji"
className={className}
onMouseEnter={this.onMouseEnter}
onMouseLeave={this.onMouseLeave}
onMouseDown={this.onMouseDown}
Expand Down
18 changes: 18 additions & 0 deletions src/Emoji/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,27 @@
background-size: $emoji_size;
background-repeat: no-repeat;
background-position: 50% 50%;
overflow: hidden;
transition: background-color .2s;

&:hover {
background-color: $hover_color;

&.has-diversities:before {
opacity: 1;
}
}

&.has-diversities:before {
content: '';
background-color: $md-blue-400;
display: block;
height: 5px;
width: 5px;
float: right;
border-radius: 50%;
opacity: 0;
transform: translateY(-4px) translateX(4px);
transition: opacity .2s;
}
}
2 changes: 1 addition & 1 deletion src/EmojiPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class EmojiPicker extends Component {
<SearchBar onChange={this.onSearch}/>
</div>
<div className={wrapperClassName}>
<DiversityPicker name={diversityPicker}
<DiversityPicker index={diversityPicker}
assetPath={assetPath}
emojiResolution={emojiResolution}
onEmojiClick={this.onEmojiClick}
Expand Down

0 comments on commit 01db0ec

Please sign in to comment.