File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ var request = require('superagent')
44
55var Catalyst = require ( '../Mixins/Catalyst' )
66
7+ var ProfileImage = require ( './ProfileImage' )
8+
79var AuthActions = require ( '../Actions/AuthActions' )
810
911var AuthStore = require ( '../Stores/AuthStore' )
@@ -243,7 +245,8 @@ module.exports = React.createClass({
243245 content = (
244246 < div className = 'logout' >
245247 < p className = 'logoutLabel' > Are you sure to logout?</ p >
246- < img className = 'userPhoto' width = '150' height = '150' src = '../vendor/dummy.jpg' /> < br />
248+
249+ < ProfileImage className = 'userPhoto' size = '150' email = { this . props . currentUser . email } /> < br />
247250 < button onClick = { this . logOut } className = 'logoutButton btn-default' > Logout</ button >
248251 </ div >
249252 )
Original file line number Diff line number Diff line change 11var React = require ( 'react/addons' )
22
3+ var ProfileImage = require ( './ProfileImage' )
4+
35var PlanetNavigator = React . createClass ( {
46 propTypes : {
57 currentPlanet : React . PropTypes . shape ( {
@@ -25,7 +27,7 @@ var PlanetNavigator = React.createClass({
2527 var users = this . props . currentPlanet . Users . map ( function ( user ) {
2628 return (
2729 < li key = { 'user-' + user . id } >
28- < img width = '44' height = '44' src = '../vendor/dummy.jpg' />
30+ < ProfileImage size = '44' email = { user . email } />
2931 < div className = 'userTooltip' > { user . profileName } </ div >
3032 </ li >
3133 )
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ var Select = require('react-select')
44
55var Catalyst = require ( '../Mixins/Catalyst' )
66
7+ var ProfileImage = require ( './ProfileImage' )
8+
79var PlanetActions = require ( '../Actions/PlanetActions' )
810
911var apiUrl = require ( '../../../config' ) . apiUrl
@@ -106,7 +108,7 @@ module.exports = React.createClass({
106108 var members = this . props . currentPlanet . Users . map ( function ( user ) {
107109 return (
108110 < li key = { 'user-' + user . id } >
109- < img className = 'userPhoto' width = '44' height = '44' src = '../vendor/dummy.jpg' />
111+ < ProfileImage className = 'userPhoto' size = '44' email = { user . email } />
110112 < div className = 'userName' > { user . name } </ div >
111113 < div className = 'userControl' >
112114 { this . props . currentPlanet . OwnerId !== user . id ? < button onClick = { this . removeUser ( user . name ) } className = 'btn-default' > Delete</ button > : < span className = 'ownerLabel' > Owner</ span > }
Original file line number Diff line number Diff line change 1+ var React = require ( 'react/addons' )
2+ var md5 = require ( 'md5' )
3+
4+ module . exports = React . createClass ( {
5+ propTypes : {
6+ email : React . PropTypes . string ,
7+ size : React . PropTypes . string ,
8+ className : React . PropTypes . string
9+ } ,
10+ render : function ( ) {
11+ return (
12+ < 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 } />
13+ )
14+ }
15+ } )
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var Link = ReactRouter.Link
55var ModalBase = require ( './ModalBase' )
66var PersonalSettingModal = require ( './PersonalSettingModal' )
77var PlanetCreateModal = require ( './PlanetCreateModal' )
8+ var ProfileImage = require ( './ProfileImage' )
89
910var AuthStore = require ( '../Stores/AuthStore' )
1011
@@ -52,8 +53,6 @@ module.exports = React.createClass({
5253 }
5354 } ,
5455 render : function ( ) {
55- console . log ( this . props . currentUser )
56- console . log ( this . props . currentPlanet )
5756 var planets = this . props . currentUser . Planets . map ( function ( planet , index ) {
5857 return (
5958 < li key = { planet . id } className = { this . props . currentPlanet != null && this . props . currentPlanet . userName === planet . userName && this . props . currentPlanet . name === planet . name ? 'active' : '' } >
@@ -75,7 +74,7 @@ module.exports = React.createClass({
7574 return (
7675 < div tabIndex = '2' className = 'UserNavigator' >
7776 < button onClick = { this . openPersonalSettingModal } className = 'userButton' >
78- < img width = '50' height = '50' src = '../vendor/dummy.jpg' />
77+ < ProfileImage size = '50' email = { this . props . currentUser . email } />
7978 </ button >
8079 < ul className = 'planetList' >
8180 { planets }
Original file line number Diff line number Diff line change 3535 "electron-stylus" : " ^0.1.0" ,
3636 "font-awesome" : " ^4.3.0" ,
3737 "markdown-it" : " ^4.3.1" ,
38+ "md5" : " ^2.0.0" ,
3839 "moment" : " ^2.10.3" ,
40+ "nib" : " ^1.1.0" ,
3941 "node-jsx" : " ^0.13.3" ,
4042 "react" : " ^0.13.3" ,
4143 "react-router" : " ^0.13.3" ,
4244 "react-select" : " ^0.5.4" ,
4345 "reflux" : " ^0.2.8" ,
44- "nib" : " ^1.1.0" ,
4546 "superagent" : " ^1.2.0"
4647 },
4748 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments