File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ var UserStore = require('../Stores/UserStore')
1414var AboutModal = require ( './AboutModal' )
1515var PlanetCreateModal = require ( './PlanetCreateModal' )
1616var TeamCreateModal = require ( './TeamCreateModal' )
17+ var LogoutModal = require ( './LogoutModal' )
1718var ProfileImage = require ( './ProfileImage' )
1819
1920module . exports = React . createClass ( {
@@ -93,9 +94,7 @@ module.exports = React.createClass({
9394 this . setState ( { isProfilePopupOpen : false } )
9495 } ,
9596 handleLogoutClick : function ( ) {
96- localStorage . removeItem ( 'currentUser' )
97- localStorage . removeItem ( 'token' )
98- this . transitionTo ( 'login' )
97+ this . openModal ( LogoutModal , { transitionTo : this . transitionTo } )
9998 } ,
10099 render : function ( ) {
101100 var params = this . getParams ( )
@@ -180,7 +179,7 @@ module.exports = React.createClass({
180179 < button onClick = { this . openAboutModal } > < i className = 'fa fa-info-circle fa-fw' /> About this app</ button >
181180 </ li >
182181 < li >
183- < button onClick = { this . handleLogoutClick } > < i className = 'fa fa-sign-out fa-fw' /> Logout </ button >
182+ < button onClick = { this . handleLogoutClick } > < i className = 'fa fa-sign-out fa-fw' /> Log out </ button >
184183 </ li >
185184 </ ul >
186185 </ div >
Original file line number Diff line number Diff line change 1+ /* global localStorage */
2+
3+ var React = require ( 'react' )
4+
5+ module . exports = React . createClass ( {
6+ propTypes : {
7+ transitionTo : React . PropTypes . func ,
8+ close : React . PropTypes . func
9+ } ,
10+ logout : function ( ) {
11+ localStorage . removeItem ( 'currentUser' )
12+ localStorage . removeItem ( 'token' )
13+ this . props . transitionTo ( 'login' )
14+ this . props . close ( )
15+ } ,
16+ render : function ( ) {
17+ return (
18+ < div className = 'LogoutModal modal' >
19+ < div className = 'messageLabel' > Are you sure to log out?</ div >
20+ < div className = 'formControl' >
21+ < button onClick = { this . props . close } > Cancel</ button >
22+ < button className = 'logoutButton' onClick = { this . logout } > Log out</ button >
23+ </ div >
24+ </ div >
25+ )
26+ }
27+ } )
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ var PlanetNavigator = React.createClass({
4242 < button onClick = { this . openLaunchModal } className = 'launchButton btn-primary btn-block' >
4343 < i className = 'fa fa-rocket fa-fw' /> Launch
4444 </ button >
45- < nav >
45+ < nav className = 'articleFilters' >
4646 < a className = { usingCodeFilter && ! usingNoteFilter ? 'active' : '' } onClick = { this . props . toggleCodeFilter } >
4747 < i className = 'fa fa-code fa-fw' /> Codes
4848 </ a >
Original file line number Diff line number Diff line change 355355 border-radius 5px
356356 display block
357357 margin 0 auto 25px
358+
359+ .LogoutModal
360+ padding 65px 0 45px
361+ width 350px
362+ .messageLabel
363+ text-align center
364+ font-size 1.1em
365+ margin-bottom 35px
366+ .formControl
367+ text-align center
368+ button
369+ btnDefault ()
370+ border-radius 5px
371+ height 44px
372+ margin 15px 5px
373+ padding 0 15px
374+ button .logoutButton
375+ btnPrimary ()
You can’t perform that action at this time.
0 commit comments