mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
22 lines
547 B
JavaScript
22 lines
547 B
JavaScript
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
|
|
|
const Avatar = React.createClass({
|
|
|
|
propTypes: {
|
|
src: React.PropTypes.string.isRequired,
|
|
size: React.PropTypes.number.isRequired
|
|
},
|
|
|
|
mixins: [PureRenderMixin],
|
|
|
|
render () {
|
|
return (
|
|
<div style={{ width: `${this.props.size}px`, height: `${this.props.size}px` }}>
|
|
<img src={this.props.src} width={this.props.size} height={this.props.size} alt='' style={{ display: 'block', borderRadius: '4px' }} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
});
|
|
|
|
export default Avatar;
|