Skip to content

Instantly share code, notes, and snippets.

@Schniz
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Schniz/10eef5af07a7b3fec02f to your computer and use it in GitHub Desktop.
Save Schniz/10eef5af07a7b3fec02f to your computer and use it in GitHub Desktop.
EmojiPicture react component. pretty basic but i needed this. It has the CJSX, JSX and JS equivalent.

EmojiPicture REACT COMPONENT!!!! WAT!!!

<EmojiPicture name="poop" height=100 width=100 />

for rendering a big poop on the client's screen. yay.

# @cjsx React.DOM
React = require('react')
EmojiPicture = React.createClass
getDefaultProps: ->
height: 20
width: 20
render: ->
<img src={ "http://a248.e.akamai.net/assets.github.com/images/icons/emoji/#{ @props.name }.png" } height={ @props.height } width={ @props.width }/>
module.exports = EmojiPicture
(function() {
var EmojiPicture, React;
React = require('react');
EmojiPicture = React.createClass({
getDefaultProps: function() {
return {
height: 20,
width: 20
};
},
render: function() {
return React.DOM.img({
"src": "http://a248.e.akamai.net/assets.github.com/images/icons/emoji/" + this.props.name + ".png",
"height": this.props.height,
"width": this.props.width
});
}
});
module.exports = EmojiPicture;
}).call(this);
/** @jsx React.DOM */
var React = require('react')
var EmojiPicture = React.createClass({
getDefaultProps: function() {
height: 20,
width: 20
},
render: function() {
return (<img src={ "http://a248.e.akamai.net/assets.github.com/images/icons/emoji/" + this.props.name + ".png" } height={ this.props.height } width={ this.props.width }/>);
}
});
module.exports = EmojiPicture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment