You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
623 B

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. const Avatar = React.createClass({
  3. propTypes: {
  4. src: React.PropTypes.string.isRequired,
  5. size: React.PropTypes.number.isRequired
  6. },
  7. mixins: [PureRenderMixin],
  8. render () {
  9. return (
  10. <div style={{ width: `${this.props.size}px`, height: `${this.props.size}px`, borderRadius: '4px', overflow: 'hidden' }} className='transparent-background'>
  11. <img src={this.props.src} width={this.props.size} height={this.props.size} alt='' style={{ display: 'block', borderRadius: '4px' }} />
  12. </div>
  13. );
  14. }
  15. });
  16. export default Avatar;