@@ -4,15 +4,6 @@ var __extends = (this && this.__extends) || function (d, b) {
4
4
function __ ( ) { this . constructor = d ; }
5
5
d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
6
6
} ;
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
- } ;
16
7
var React = require ( 'react' ) ;
17
8
var react_redux_1 = require ( 'react-redux' ) ;
18
9
var actions_1 = require ( '../../actions' ) ;
@@ -38,22 +29,11 @@ var Alert = (function (_super) {
38
29
var action = alert . action , message = alert . message , open = alert . open , duration = alert . duration ;
39
30
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 } ) ) ;
40
31
} ;
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 ) ;
47
32
return Alert ;
48
33
} ( React . Component ) ) ;
34
+ var mapStateToProps = function ( state ) { return ( {
35
+ alert : state . alert || defaultAlert ,
36
+ } ) ; } ;
37
+ var mapDispatchToProps = { alertClose : actions_1 . alertClose } ;
49
38
Object . 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