11import React from 'react' ;
22import { Alert , Col } from 'reactstrap' ;
33
4- import './animate.css' ;
5-
6- class NotificationAlert extends React . Component {
4+ class NotificationSystem extends React . Component {
75 constructor ( props ) {
86 super ( props ) ;
97 this . state = {
@@ -15,10 +13,7 @@ class NotificationAlert extends React.Component {
1513 notifyBR : [ ]
1614 } ;
1715 this . onDismiss = this . onDismiss . bind ( this ) ;
18- this . notificationAlert = this . notificationAlert . bind ( this ) ;
19- }
20- heyFunc ( ) {
21- console . log ( "hey" ) ;
16+ this . notify = this . notify . bind ( this ) ;
2217 }
2318 onDismiss ( nNumber , place , noAnimate ) {
2419
@@ -59,7 +54,7 @@ class NotificationAlert extends React.Component {
5954 sNotify [ "notify" + place . toUpperCase ( ) ] = notify ;
6055 this . setState ( sNotify ) ;
6156 }
62- notificationAlert ( options ) {
57+ notify ( options ) {
6358 var notify = this . state [ "notify" + options . place . toUpperCase ( ) ] ;
6459 var nNumber = notify . length ;
6560 if ( notify . length > 0 ) {
@@ -71,8 +66,8 @@ class NotificationAlert extends React.Component {
7166 }
7267 var notification = React . createElement (
7368 Alert ,
74- { color : options . type , className : 'alert-with-icon animated fadeInDown' , toggle : ( ) => this . onDismiss ( nNumber , options . place ) , key : nNumber } ,
75- React . createElement ( 'span' , { 'data-notify' : 'icon' , className : 'now-ui-icons ui-1_bell-53' } ) ,
69+ { color : options . type , className : 'alert-with-icon animated fadeInDown' , closeClassName : 'now-ui-icons ui-1_simple-remove' , toggle : ( ) => this . onDismiss ( nNumber , options . place ) , key : nNumber } ,
70+ options . icon !== undefined ? React . createElement ( 'span' , { 'data-notify' : 'icon' , className : options . icon } ) : null ,
7671 React . createElement (
7772 'span' ,
7873 { 'data-notify' : 'message' } ,
@@ -151,4 +146,4 @@ class NotificationAlert extends React.Component {
151146 }
152147}
153148
154- export default NotificationAlert ;
149+ export default NotificationSystem ;
0 commit comments