@@ -47,13 +47,13 @@ var TutorialInfo = (function (_super) {
4747 TutorialInfo . prototype . componentDidMount = function ( ) {
4848 Top_1 . default . toggle ( false ) ;
4949 } ;
50- TutorialInfo . prototype . handleSubmit = function ( e ) {
51- console . log ( e ) ;
50+ TutorialInfo . prototype . onSubmit = function ( values ) {
51+ var description = values . description , version = values . version , keywords = values . keywords ;
52+ this . props . save ( Object . assign ( { } , this . props . packageJson , { description : description , version : version , keywords : keywords } ) ) ;
5253 } ;
5354 TutorialInfo . prototype . render = function ( ) {
54- var _a = this . props . packageJson , description = _a . description , version = _a . version , keywords = _a . keywords ;
55- var _b = this . props , pristine = _b . pristine , submitting = _b . submitting ;
56- return ( React . createElement ( Card_1 . Card , { style : styles . card } , React . createElement ( Card_1 . CardHeader , { title : 'Tutorial Info' } ) , React . createElement ( "form" , { onSubmit : this . handleSubmit } , React . createElement ( redux_form_1 . Field , { name : 'description' , component : function ( description ) { return ( React . createElement ( TextField_1 . default , __assign ( { name : 'description' , className : 'native-key-bindings' , hintText : 'Tutorial Description' , floatingLabelText : 'Description' , errorText : description . touched && description . error } , description ) ) ) ; } } ) , React . createElement ( "br" , null ) , React . createElement ( redux_form_1 . Field , { name : 'version' , component : function ( version ) { return ( React . createElement ( TextField_1 . default , __assign ( { name : 'version' , className : 'native-key-bindings' , hintText : '0.1.0' , disabled : true , floatingLabelText : 'Version' , errorText : version . touched && version . error } , version ) ) ) ; } } ) , React . createElement ( "br" , null ) , React . createElement ( "br" , null ) , React . createElement ( RaisedButton_1 . default , { type : 'submit' , style : styles . button , label : 'Save' , primary : true , disabled : pristine || submitting } ) ) ) ) ;
55+ var _a = this . props , pristine = _a . pristine , submitting = _a . submitting , handleSubmit = _a . handleSubmit , invalid = _a . invalid ;
56+ return ( React . createElement ( Card_1 . Card , { style : styles . card } , React . createElement ( Card_1 . CardHeader , { title : 'Tutorial Info' } ) , React . createElement ( "form" , { onSubmit : handleSubmit ( this . onSubmit . bind ( this ) ) } , React . createElement ( redux_form_1 . Field , { name : 'description' , component : function ( description ) { return ( React . createElement ( TextField_1 . default , __assign ( { name : 'description' , className : 'native-key-bindings' , hintText : 'Tutorial Description' , floatingLabelText : 'Description' , errorText : description . touched && description . error } , description ) ) ) ; } } ) , React . createElement ( "br" , null ) , React . createElement ( redux_form_1 . Field , { name : 'version' , component : function ( version ) { return ( React . createElement ( TextField_1 . default , __assign ( { name : 'version' , className : 'native-key-bindings' , hintText : '0.1.0' , disabled : true , floatingLabelText : 'Version' , errorText : version . touched && version . error } , version ) ) ) ; } } ) , React . createElement ( "br" , null ) , React . createElement ( "br" , null ) , React . createElement ( RaisedButton_1 . default , { type : 'submit' , style : styles . button , label : 'Save' , primary : true , disabled : pristine || submitting || invalid } ) ) ) ) ;
5757 } ;
5858 TutorialInfo = __decorate ( [
5959 react_redux_1 . connect ( function ( state ) { return ( {
0 commit comments