11import React , { Component , Fragment } from 'react' ;
22import { connect } from 'react-redux' ;
33import PropTypes from 'prop-types' ;
4- import Notifications from 'reapop' ;
5- import wybo from 'reapop-theme-wybo' ;
4+ import NotificationsSystem , { wyboTheme } from 'reapop' ;
65import { bindActionCreators } from 'redux' ;
76
87import { ROOT } from '../../constants/extension-points' ;
@@ -22,7 +21,8 @@ class Report extends Component {
2221 // from store
2322 allRootSuiteIds : PropTypes . arrayOf ( PropTypes . string ) . isRequired ,
2423 fetchDbDetails : PropTypes . array . isRequired ,
25- customScripts : PropTypes . array
24+ customScripts : PropTypes . array ,
25+ notifications : PropTypes . array
2626 }
2727
2828 componentDidMount ( ) {
@@ -34,12 +34,13 @@ class Report extends Component {
3434 }
3535
3636 render ( ) {
37- const { allRootSuiteIds, fetchDbDetails} = this . props ;
37+ const { allRootSuiteIds, fetchDbDetails, notifications, actions} = this . props ;
38+ const notificationElem = < NotificationsSystem theme = { wyboTheme } notifications = { notifications } dismissNotification = { actions . dismissNotification } /> ;
3839
3940 if ( ! allRootSuiteIds . length && ! fetchDbDetails . length ) {
4041 return (
4142 < Fragment >
42- < Notifications theme = { wybo } />
43+ { notificationElem }
4344 < Loading active = { true } />
4445 </ Fragment >
4546 ) ;
@@ -49,7 +50,7 @@ class Report extends Component {
4950 < Fragment >
5051 < ExtensionPoint name = { ROOT } >
5152 < CustomScripts scripts = { this . props . customScripts } />
52- < Notifications theme = { wybo } />
53+ { notificationElem }
5354 < FaviconChanger />
5455 < Header />
5556 < ControlButtons />
@@ -65,10 +66,11 @@ class Report extends Component {
6566}
6667
6768export default connect (
68- ( { tree, fetchDbDetails, config} ) => ( {
69+ ( { tree, fetchDbDetails, config, notifications } ) => ( {
6970 allRootSuiteIds : tree . suites . allRootIds ,
7071 fetchDbDetails,
71- customScripts : config . customScripts
72+ customScripts : config . customScripts ,
73+ notifications
7274 } ) ,
7375 ( dispatch ) => ( { actions : bindActionCreators ( actions , dispatch ) } )
7476) ( Report ) ;
0 commit comments