@@ -10,6 +10,7 @@ var actions_1 = require('../../actions');
1010var ProgressPage_1 = require ( './ProgressPage' ) ;
1111var List_1 = require ( 'material-ui/List' ) ;
1212var Paper_1 = require ( 'material-ui/Paper' ) ;
13+ var RaisedButton_1 = require ( 'material-ui/RaisedButton' ) ;
1314var Subheader_1 = require ( 'material-ui/Subheader' ) ;
1415var styles = {
1516 page : {
@@ -18,19 +19,35 @@ var styles = {
1819 list : {
1920 margin : '5px' ,
2021 } ,
22+ options : {
23+ display : 'flex' ,
24+ justifyContent : 'center' ,
25+ marginTop : '10px' ,
26+ opacity : '0.6' ,
27+ } ,
2128} ;
2229var Progress = ( function ( _super ) {
2330 __extends ( Progress , _super ) ;
2431 function Progress ( ) {
2532 _super . apply ( this , arguments ) ;
2633 }
34+ Progress . prototype . verifyReset = function ( ) {
35+ var reset = confirm ( 'Are you sure you want to erase your progress?' ) ;
36+ if ( reset ) {
37+ this . props . progressReset ( ) ;
38+ }
39+ } ;
2740 Progress . prototype . render = function ( ) {
2841 var _a = this . props , info = _a . info , tutorial = _a . tutorial ;
29- return ( React . createElement ( Paper_1 . default , { style : styles . page } ,
30- React . createElement ( List_1 . List , { style : styles . list } ,
31- React . createElement ( Subheader_1 . default , null , info . title ) ,
32- tutorial . pages . map ( function ( page , index ) { return ( React . createElement ( ProgressPage_1 . default , { key : index , index : index , page : page } ) ) ; } ) )
33- ) ) ;
42+ return ( React . createElement ( "div" , null ,
43+ React . createElement ( Paper_1 . default , { style : styles . page } ,
44+ React . createElement ( List_1 . List , { style : styles . list } ,
45+ React . createElement ( Subheader_1 . default , null , info . title ) ,
46+ tutorial . pages . map ( function ( page , index ) { return ( React . createElement ( ProgressPage_1 . default , { key : index , index : index , page : page } ) ) ; } ) )
47+ ) ,
48+ React . createElement ( "div" , { style : styles . options } ,
49+ React . createElement ( RaisedButton_1 . default , { label : "Reset" , onClick : this . verifyReset . bind ( this ) } )
50+ ) ) ) ;
3451 } ;
3552 Progress . prototype . componentWillMount = function ( ) {
3653 this . props . progressLoad ( ) ;
@@ -42,7 +59,8 @@ var mapStateToProps = function (state) { return ({
4259 tutorial : state . tutorial ,
4360} ) ; } ;
4461var mapDispatchToProps = {
45- progressLoad : actions_1 . progressLoad
62+ progressLoad : actions_1 . progressLoad ,
63+ progressReset : actions_1 . progressReset
4664} ;
4765Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
4866exports . default = react_redux_1 . connect ( mapStateToProps , mapDispatchToProps ) ( Progress ) ;
0 commit comments