@@ -11,6 +11,8 @@ var index_1 = require('../../index');
11
11
var HintButton_1 = require ( './HintButton' ) ;
12
12
var Card_1 = require ( 'material-ui/Card' ) ;
13
13
var help_1 = require ( 'material-ui/svg-icons/action/help' ) ;
14
+ var actions_1 = require ( '../../../actions' ) ;
15
+ var selectors_2 = require ( '../../../selectors' ) ;
14
16
var styles = {
15
17
position :'relative' ,
16
18
margin :'5px auto 10px' ,
@@ -23,23 +25,26 @@ var Hints = (function (_super) {
23
25
_super . apply ( this , arguments ) ;
24
26
}
25
27
Hints . prototype . render = function ( ) {
26
- var hint = this . props . hint ;
28
+ var _a = this . props , hint = _a . hint , hintPosition = _a . hintPosition , hintsLength = _a . hintsLength , hintPositionSet = _a . hintPositionSet ;
27
29
if ( ! hint ) {
28
30
return null ;
29
31
}
30
32
return ( React . createElement ( Card_1 . Card , { style :styles } ,
31
33
React . createElement ( Card_1 . CardHeader , { title :'Hints' , avatar :React . createElement ( help_1 . default , null ) , actAsExpander :true , showExpandableButton :true } ) ,
32
34
React . createElement ( Card_1 . CardText , { className :'cr-task-hint' , expandable :true } ,
33
- React . createElement ( index_1 . Markdown , null , hint )
35
+ React . createElement ( index_1 . Markdown , { children : hint } )
34
36
) ,
35
37
React . createElement ( Card_1 . CardActions , { style :{ paddingBottom :'30px !important' } , expandable :true , className :'cr-task-hints-actions' } ,
36
- React . createElement ( HintButton_1 . default , { type :'prev' , label :'Previous' } ) ,
37
- React . createElement ( HintButton_1 . default , { type :'next' , label :'Next' } ) ) ) ) ;
38
+ React . createElement ( HintButton_1 . default , { type :'prev' , label :'Previous' , hintPosition : hintPosition , hintsLength : hintsLength , hintPositionSet : hintPositionSet } ) ,
39
+ React . createElement ( HintButton_1 . default , { type :'next' , label :'Next' , hintPosition : hintPosition , hintsLength : hintsLength , hintPositionSet : hintPositionSet } ) ) ) ) ;
38
40
} ;
39
41
return Hints ;
40
42
} ( React . Component ) ) ;
41
43
var mapStateToProps = function ( state ) { return ( {
42
44
hint :selectors_1 . hintSelector ( state ) ,
45
+ hintPosition :state . hintPosition ,
46
+ hintsLength :selectors_2 . hintsSelector ( state ) . length ,
43
47
} ) ; } ;
48
+ var mapDispatchToProps = { hintPositionSet :actions_1 . hintPositionSet } ;
44
49
Object . defineProperty ( exports , "__esModule" , { value :true } ) ;
45
- exports . default = react_redux_1 . connect ( mapStateToProps ) ( Hints ) ;
50
+ exports . default = react_redux_1 . connect ( mapStateToProps , mapDispatchToProps ) ( Hints ) ;