@@ -188,15 +188,11 @@ export default class VoteApp extends React.Component {
188
188
< Influence className = "vote-app__influence-section" type = "golden" />
189
189
</ div >
190
190
< div className = "vote-app__user-section" >
191
- { this . renderSelf ( ) }
191
+ { this . renderSelf ( inProgress ) }
192
192
</ div >
193
193
</ div >
194
194
</ div >
195
195
{ listInfo && < div >
196
- { voteAppToken && < button className = "vote-app__update-button" disabled = { inProgress } onClick = { ( ) => {
197
- this . updateSelf ( ) ;
198
- this . updateList ( ) ;
199
- } } > Update</ button > }
200
196
< h1 > { listInfo . displayName } </ h1 >
201
197
< div > { listInfo . description } </ div >
202
198
< ul className = "vote-app__items-list" >
@@ -265,7 +261,7 @@ export default class VoteApp extends React.Component {
265
261
) ;
266
262
}
267
263
268
- renderSelf ( ) {
264
+ renderSelf ( inProgress ) {
269
265
let { listInfo, selfInfo, isFetchingSelf } = this . state ;
270
266
if ( ! selfInfo ) {
271
267
if ( isFetchingSelf ) {
@@ -276,17 +272,27 @@ export default class VoteApp extends React.Component {
276
272
} } > Login with Github < img src = { GithubMark } /> </ button > </ div > ;
277
273
} else {
278
274
return < div className = "vote-app__self-info" >
279
- You are logged in as { selfInfo . login } . < button onClick = { ( ) => {
280
- delete window . localStorage . voteAppToken ;
281
- window . location . reload ( ) ;
282
- } } > Log out </ button >
275
+ < div className = "vote-app__userinfo" >
276
+ < img alt = { selfInfo . login } src = { selfInfo . avatar } />
277
+ { selfInfo . login }
278
+ </ div >
283
279
{ listInfo && < ul className = "vote-app__currency-list" >
284
280
{ selfInfo . currencies
285
281
. filter ( currency => listInfo . possibleVotes . some ( voteSettings => voteSettings . currency === currency . name ) )
286
282
. map ( currency => < li className = { "vote-app__currency-" + currency . name } title = { `${ currency . description } \nYou used ${ currency . used } of a total of ${ currency . value } ${ currency . displayName } .` } >
287
283
{ currency . remaining } { currency . displayName }
288
284
</ li > ) }
289
285
</ ul > }
286
+ < div className = "vote-app__button-area" >
287
+ < button className = "vote-app__logout-button" onClick = { ( ) => {
288
+ delete window . localStorage . voteAppToken ;
289
+ window . location . reload ( ) ;
290
+ } } > Logout</ button >
291
+ < button className = "vote-app__update-button" disabled = { inProgress } onClick = { ( ) => {
292
+ this . updateSelf ( ) ;
293
+ this . updateList ( ) ;
294
+ } } > Update</ button >
295
+ </ div >
290
296
</ div > ;
291
297
}
292
298
}
0 commit comments