mastodon/app/assets/javascripts/components/components/avatar.jsx

24 lines
603 B
React
Raw Normal View History

import PureRenderMixin from 'react-addons-pure-render-mixin';
2016-08-24 19:08:00 +00:00
const Avatar = React.createClass({
propTypes: {
2016-08-31 20:58:10 +00:00
src: React.PropTypes.string.isRequired,
size: React.PropTypes.number.isRequired,
style: React.PropTypes.object
2016-08-24 19:08:00 +00:00
},
mixins: [PureRenderMixin],
2016-08-24 19:08:00 +00:00
render () {
return (
<div style={{ ...this.props.style, width: `${this.props.size}px`, height: `${this.props.size}px` }}>
2016-08-31 20:58:10 +00:00
<img src={this.props.src} width={this.props.size} height={this.props.size} alt='' style={{ display: 'block', borderRadius: '4px' }} />
2016-08-24 19:08:00 +00:00
</div>
);
}
});
export default Avatar;