mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-23 06:31:51 +00:00
実装:Profile Imageとしてgravatar Icon使用
This commit is contained in:
15
browser/main/Components/ProfileImage.jsx
Normal file
15
browser/main/Components/ProfileImage.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
var React = require('react/addons')
|
||||
var md5 = require('md5')
|
||||
|
||||
module.exports = React.createClass({
|
||||
propTypes: {
|
||||
email: React.PropTypes.string,
|
||||
size: React.PropTypes.string,
|
||||
className: React.PropTypes.string
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<img className={this.props.className} width={this.props.size} height={this.props.size} src={'http://www.gravatar.com/avatar/' + md5(this.props.email.trim().toLowerCase()) + '?s=' + this.props.size}/>
|
||||
)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user