@@ -15,7 +15,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1515} ;
1616var React = require ( 'react' ) ;
1717var react_redux_1 = require ( 'react-redux' ) ;
18- var path_1 = require ( 'path' ) ;
1918var actions_1 = require ( '../../../actions' ) ;
2019var core_coderoad_1 = require ( 'core-coderoad' ) ;
2120var styles = {
@@ -29,19 +28,14 @@ var Tests = (function (_super) {
2928 _super . apply ( this , arguments ) ;
3029 }
3130 Tests . prototype . render = function ( ) {
32- var _a = this . props , tests = _a . tests , style = _a . style , open = _a . open ;
33- return ( React . createElement ( "div" , { style : style } , tests . map ( function ( file , index ) { return ( React . createElement ( "button" , null , file ) ) ; } ) ) ) ;
31+ var _this = this ;
32+ var _a = this . props , tests = _a . tests , style = _a . style , editorTestOpen = _a . editorTestOpen ;
33+ return ( React . createElement ( "div" , { style : style } , tests . map ( function ( file , index ) { return ( React . createElement ( "button" , { onClick : editorTestOpen . bind ( _this , file ) } , file ) ) ; } ) ) ) ;
3434 } ;
3535 Tests = __decorate ( [
3636 react_redux_1 . connect ( function ( state ) { return ( {
3737 config : core_coderoad_1 . configSelector ( state ) ,
38- } ) ; } , function ( dispatch , props ) { return ( {
39- open : function ( file ) {
40- var suffix = core_coderoad_1 . tutorialConfigOptions [ props . config . language ] . language . suffix ;
41- file = file . concat ( '.' + suffix ) ;
42- dispatch ( actions_1 . editorOpen ( path_1 . join ( 'tutorial' , file ) ) ) ;
43- } ,
44- } ) ; } ) ,
38+ } ) ; } , { editorTestOpen : actions_1 . editorTestOpen } ) ,
4539 __metadata ( 'design:paramtypes' , [ ] )
4640 ] , Tests ) ;
4741 return Tests ;
0 commit comments