@@ -4,15 +4,6 @@ var __extends = (this && this.__extends) || function (d, b) {
44 function __ ( ) { this . constructor = d ; }
55 d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
66} ;
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- } ;
167var React = require ( 'react' ) ;
178var react_redux_1 = require ( 'react-redux' ) ;
189var actions_1 = require ( '../../actions' ) ;
@@ -38,22 +29,11 @@ var Alert = (function (_super) {
3829 var action = alert . action , message = alert . message , open = alert . open , duration = alert . duration ;
3930 return ( React . createElement ( Snackbar_1 . default , { className : 'cr-alert ' + action , style : styles . snackbar , open : open , action : action || 'NOTE' , message : message || '' , autoHideDuration : duration || 2000 , onActionTouchTap : alertClose , onRequestClose : alertClose } ) ) ;
4031 } ;
41- Alert = __decorate ( [
42- react_redux_1 . connect ( function ( state ) { return ( {
43- alert : state . alert || defaultAlert ,
44- } ) ; } , { alertClose : actions_1 . alertClose } ) ,
45- __metadata ( 'design:paramtypes' , [ ] )
46- ] , Alert ) ;
4732 return Alert ;
4833} ( React . Component ) ) ;
34+ var mapStateToProps = function ( state ) { return ( {
35+ alert : state . alert || defaultAlert ,
36+ } ) ; } ;
37+ var mapDispatchToProps = { alertClose : actions_1 . alertClose } ;
4938Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
50- exports . default = Alert ;
51- Alert . propTypes = {
52- alert : React . PropTypes . shape ( {
53- action : React . PropTypes . string ,
54- message : React . PropTypes . string ,
55- duration : React . PropTypes . number . optional ,
56- color : React . PropTypes . string ,
57- } ) ,
58- alertClose : React . PropTypes . func . optional
59- } ;
39+ exports . default = react_redux_1 . connect ( mapStateToProps , mapDispatchToProps ) ( Alert ) ;
0 commit comments