import React, {Component, PropTypes} from 'react'; import crypto from 'crypto'; class GravatarImg extends Component { render () { const {email, size, className} = this.props; const sanitizedEmail = email.trim().toLowerCase(); const hash = crypto .createHash('md5') .update(sanitizedEmail) .digest('hex'); const url = `https://www.gravatar.com/avatar/${hash}?s=${size * 2}`; const cssSize = `${size}px`; return ( Profile picture ) } } GravatarImg.propTypes = { email: PropTypes.string.isRequired, size: PropTypes.number }; export default GravatarImg;