11import React from 'react' ;
22import PropTypes from 'prop-types' ;
3- import store from './store' ;
4- import ReactNotification from './react-notification ' ;
5- import { getNotificationsForEachContainer , getNotificationsForMobileView } from './utils/helpers' ;
3+ import store from '.. /store' ;
4+ import ReactNotification from './Notification ' ;
5+ import { getNotificationsForEachContainer , getNotificationsForMobileView } from '.. /utils/helpers' ;
66
77import 'src/scss/notification.scss' ;
88
9- export default class ReactNotificationComponent extends React . Component {
9+ class Container extends React . Component {
1010 constructor ( props ) {
1111 super ( props ) ;
1212
@@ -107,11 +107,7 @@ export default class ReactNotificationComponent extends React.Component {
107107 const bottom = this . renderNotifications ( mobileNotifications . bottom ) ;
108108
109109 return (
110- < div
111- id = { id }
112- key = 'mobile'
113- className = { `react-notification-root ${ className || '' } ` }
114- >
110+ < div id = { id } key = "mobile" className = { `react-notification-root ${ className || '' } ` } >
115111 < div className = "notification-container-mobile-top" > { top } </ div >
116112 < div className = "notification-container-mobile-bottom" > { bottom } </ div >
117113 </ div >
@@ -121,25 +117,25 @@ export default class ReactNotificationComponent extends React.Component {
121117 renderScreenNotifications ( props ) {
122118 const { className, id } = props ;
123119 const { notifications } = this . state ;
124- const notificationsPerContainer = getNotificationsForEachContainer ( notifications ) ;
125- const topLeft = this . renderNotifications ( notificationsPerContainer . topLeft ) ;
126- const topRight = this . renderNotifications ( notificationsPerContainer . topRight ) ;
127- const topCenter = this . renderNotifications ( notificationsPerContainer . topCenter ) ;
128- const bottomLeft = this . renderNotifications ( notificationsPerContainer . bottomLeft ) ;
129- const bottomRight = this . renderNotifications ( notificationsPerContainer . bottomRight ) ;
130- const bottomCenter = this . renderNotifications ( notificationsPerContainer . bottomCenter ) ;
120+ const items = getNotificationsForEachContainer ( notifications ) ;
121+ const topLeft = this . renderNotifications ( items . topLeft ) ;
122+ const topRight = this . renderNotifications ( items . topRight ) ;
123+ const topCenter = this . renderNotifications ( items . topCenter ) ;
124+ const bottomLeft = this . renderNotifications ( items . bottomLeft ) ;
125+ const bottomRight = this . renderNotifications ( items . bottomRight ) ;
126+ const bottomCenter = this . renderNotifications ( items . bottomCenter ) ;
127+ const center = this . renderNotifications ( items . center ) ;
131128
132129 return (
133- < div
134- id = { id }
135- key = 'screen'
136- className = { `react-notification-root ${ className || '' } ` }
137- >
130+ < div id = { id } key = "screen" className = { `react-notification-root ${ className || '' } ` } >
138131 < div className = "notification-container-top-left" > { topLeft } </ div >
139132 < div className = "notification-container-top-right" > { topRight } </ div >
140133 < div className = "notification-container-bottom-left" > { bottomLeft } </ div >
141134 < div className = "notification-container-bottom-right" > { bottomRight } </ div >
142135 < div className = "notification-container-top-center" > { topCenter } </ div >
136+ < div className = "notification-container-center" >
137+ < div className = "center-inner" > { center } </ div >
138+ </ div >
143139 < div className = "notification-container-bottom-center" > { bottomCenter } </ div >
144140 </ div >
145141 ) ;
@@ -157,4 +153,4 @@ export default class ReactNotificationComponent extends React.Component {
157153 }
158154}
159155
160- export { store } ;
156+ export default Container ;
0 commit comments