about summary refs log tree commit diff
path: root/app/assets/javascripts/components/components/avatar.jsx
blob: 6177683ba710d5d15e071f8ded645530916fe91c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;