@@ -17,28 +17,29 @@ var React = require('react');
17
17
var react_redux_1 = require ( 'react-redux' ) ;
18
18
var actions_1 = require ( '../../../actions' ) ;
19
19
var FlatButton_1 = require ( 'material-ui/FlatButton' ) ;
20
- function displayName ( name ) {
21
- if ( name . match ( / ^ c o d e r o a d - t u t o r i a l - / ) ) {
22
- return name . slice ( 18 ) ;
23
- }
24
- else if ( name . match ( / ^ c o d e r o a d - / ) ) {
25
- return name . slice ( 9 ) ;
26
- }
27
- return name ;
28
- }
29
20
var SelectTutorial = ( function ( _super ) {
30
21
__extends ( SelectTutorial , _super ) ;
31
22
function SelectTutorial ( ) {
32
23
_super . apply ( this , arguments ) ;
33
24
}
25
+ SelectTutorial . prototype . displayName = function ( name ) {
26
+ if ( name . match ( / ^ c o d e r o a d - t u t o r i a l - / ) ) {
27
+ return name . slice ( 18 ) ;
28
+ }
29
+ else if ( name . match ( / ^ c o d e r o a d - / ) ) {
30
+ return name . slice ( 9 ) ;
31
+ }
32
+ return name ;
33
+ } ;
34
34
SelectTutorial . prototype . render = function ( ) {
35
35
var _a = this . props , tutorial = _a . tutorial , selectTutorial = _a . selectTutorial ;
36
- var title = tutorial . title ;
37
- return ( React . createElement ( FlatButton_1 . default , { label : displayName ( title ) , primary : true , onTouchTap : selectTutorial . bind ( this , title ) } ) ) ;
36
+ console . log ( 'tutorial' , tutorial ) ;
37
+ var name = tutorial . name ;
38
+ return ( React . createElement ( FlatButton_1 . default , { label : this . displayName ( name ) , primary : true , onTouchTap : selectTutorial . bind ( this , name ) } ) ) ;
38
39
} ;
39
40
SelectTutorial = __decorate ( [
40
41
react_redux_1 . connect ( null , function ( dispatch ) { return ( {
41
- selectTutorial : function ( title ) { return dispatch ( actions_1 . tutorialSet ( name ) ) ; } ,
42
+ selectTutorial : function ( name ) { return dispatch ( actions_1 . tutorialSet ( name ) ) ; } ,
42
43
} ) ; } ) ,
43
44
__metadata ( 'design:paramtypes' , [ ] )
44
45
] , SelectTutorial ) ;
0 commit comments