@@ -28,30 +28,21 @@ var ProgressPage = (function (_super) {
28
28
function ProgressPage ( ) {
29
29
_super . apply ( this , arguments ) ;
30
30
}
31
- ProgressPage . prototype . canActivate = function ( isActive ) {
32
- var _a = this . props , index = _a . index , position = _a . position , progress = _a . progress ;
33
- var completed = progress . pages [ index ] ;
34
- return isActive || completed ;
35
- } ;
36
31
ProgressPage . prototype . render = function ( ) {
37
- console . log ( this . props ) ;
38
- var _a = this . props , page = _a . page , position = _a . position , index = _a . index , progress = _a . progress , selectPage = _a . selectPage ;
39
- var isActive = index === position . page ;
40
- var canActivate = this . canActivate ( isActive ) ;
41
- var completed = progress . pages [ index ] ;
42
- return ( React . createElement ( List_1 . ListItem , { key :index , style :Object . assign ( { } , styles , ! canActivate ?{ color :colors_1 . grey400 } :{ } ) , primaryText :( index + 1 ) + ". " + page . title , secondaryText :canActivate ?page . description :'' , leftIcon :progressIcon_1 . progressIcon ( completed , isActive ) , onClick :canActivate
43
- ?selectPage . bind ( this , {
44
- page :index
45
- } )
32
+ var _a = this . props , page = _a . page , pagePosition = _a . pagePosition , index = _a . index , progress = _a . progress , selectPage = _a . selectPage ;
33
+ var isCompleted = progress . pages [ index ] || false ;
34
+ var canActivate = index >= pagePosition ;
35
+ return ( React . createElement ( List_1 . ListItem , { key :index , style :Object . assign ( { } , styles , ! canActivate ?{ color :colors_1 . grey400 } :{ } ) , primaryText :( index + 1 ) + ". " + page . title , secondaryText :page . description , leftIcon :progressIcon_1 . progressIcon ( isCompleted , index === pagePosition ) , onClick :canActivate
36
+ ?selectPage . bind ( this , index )
46
37
:function ( ) { return ; } } ) ) ;
47
38
} ;
48
39
;
49
40
ProgressPage = __decorate ( [
50
41
react_redux_1 . connect ( null , function ( dispatch ) {
51
42
return {
52
- selectPage :function ( position ) {
53
- dispatch ( actions_1 . pageSet ( position ) ) ;
54
- dispatch ( actions_1 . testsLoad ( ) ) ;
43
+ selectPage :function ( pagePosition ) {
44
+ dispatch ( actions_1 . pageSet ( pagePosition ) ) ;
45
+ dispatch ( actions_1 . testsLoad ( pagePosition ) ) ;
55
46
dispatch ( actions_1 . routeSet ( 'page' ) ) ;
56
47
}
57
48
} ;