1
1
"use strict" ;
2
+ var __extends = ( this && this . __extends ) || function ( d , b ) {
3
+ for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
4
+ function __ ( ) { this . constructor = d ; }
5
+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
6
+ } ;
7
+ var __decorate = ( this && this . __decorate ) || function ( decorators , target , key , desc ) {
8
+ var c = arguments . length , r = c < 3 ? target : desc === null ? desc = Object . getOwnPropertyDescriptor ( target , key ) : desc , d ;
9
+ if ( typeof Reflect === "object" && typeof Reflect . decorate === "function" ) r = Reflect . decorate ( decorators , target , key , desc ) ;
10
+ else for ( var i = decorators . length - 1 ; i >= 0 ; i -- ) if ( d = decorators [ i ] ) r = ( c < 3 ? d ( r ) : c > 3 ? d ( target , key , r ) : d ( target , key ) ) || r ;
11
+ return c > 3 && r && Object . defineProperty ( target , key , r ) , r ;
12
+ } ;
13
+ var __metadata = ( this && this . __metadata ) || function ( k , v ) {
14
+ if ( typeof Reflect === "object" && typeof Reflect . metadata === "function" ) return Reflect . metadata ( k , v ) ;
15
+ } ;
2
16
var React = require ( 'react' ) ;
17
+ var react_redux_1 = require ( 'react-redux' ) ;
3
18
var index_1 = require ( '../index' ) ;
4
19
var Tasks_1 = require ( './Tasks' ) ;
5
20
var Hints_1 = require ( './Hints' ) ;
@@ -9,11 +24,30 @@ var styles = {
9
24
width : '100%' ,
10
25
overflowY : 'scroll' ,
11
26
} ;
12
- var Page = function ( _a ) {
13
- var page = _a . page , taskPosition = _a . taskPosition , hintPosition = _a . hintPosition , tasks = _a . tasks , testRun = _a . testRun , progress = _a . progress , pagePosition = _a . pagePosition ;
14
- var task = taskPosition <= tasks . length ? tasks [ taskPosition ] : null ;
15
- var completed = progress . pages [ pagePosition ] ;
16
- return ( React . createElement ( "section" , { style : styles , className : 'cr-page' } , React . createElement ( index_1 . ContentCard , { title : page . title , content : page . description } ) , React . createElement ( Tasks_1 . default , { tasks : tasks , taskPosition : taskPosition , testRun : testRun , completed : completed , page : page } ) , React . createElement ( PageToolbar_1 . default , { tasks : tasks , taskPosition : taskPosition } , React . createElement ( Hints_1 . default , { task : task , hintPosition : hintPosition } ) , React . createElement ( ProgressBar_1 . default , { taskLength : tasks . length , taskPosition : taskPosition , completed : completed } ) ) ) ) ;
17
- } ;
27
+ var Page = ( function ( _super ) {
28
+ __extends ( Page , _super ) ;
29
+ function Page ( ) {
30
+ _super . apply ( this , arguments ) ;
31
+ }
32
+ Page . prototype . render = function ( ) {
33
+ var _a = this . props , page = _a . page , tasks = _a . tasks , taskPosition = _a . taskPosition , hintPosition = _a . hintPosition , testRun = _a . testRun , progress = _a . progress , pagePosition = _a . pagePosition ;
34
+ var task = taskPosition <= tasks . length ? tasks [ taskPosition ] : null ;
35
+ var completed = progress . pages [ pagePosition ] ;
36
+ return ( React . createElement ( "section" , { style : styles , className : 'cr-page' } , React . createElement ( index_1 . ContentCard , { title : page . title , content : page . description } ) , React . createElement ( Tasks_1 . default , { tasks : tasks , taskPosition : taskPosition , testRun : testRun , completed : completed , page : page } ) , React . createElement ( PageToolbar_1 . default , { tasks : tasks , taskPosition : taskPosition } , React . createElement ( Hints_1 . default , { task : task , hintPosition : hintPosition } ) , React . createElement ( ProgressBar_1 . default , { taskLength : tasks . length , taskPosition : taskPosition , completed : completed } ) ) ) ) ;
37
+ } ;
38
+ Page = __decorate ( [
39
+ react_redux_1 . connect ( function ( state ) { return ( {
40
+ page : state . page ,
41
+ tasks : state . tasks ,
42
+ taskPosition : state . taskPosition ,
43
+ hintPosition : state . hintPosition ,
44
+ testRun : state . testRun ,
45
+ progress : state . progress ,
46
+ pagePosition : state . pagePosition ,
47
+ } ) ; } ) ,
48
+ __metadata ( 'design:paramtypes' , [ ] )
49
+ ] , Page ) ;
50
+ return Page ;
51
+ } ( React . Component ) ) ;
18
52
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
19
53
exports . default = Page ;
0 commit comments