@@ -5,7 +5,7 @@ import Modal from 'react-modal';
55// import classSet from 'classnames';
66import Const from '../Const' ;
77// import editor from '../Editor';
8- import Notifier from '../Notification.js' ;
8+ import { notice } from '../Notification.js' ;
99import InsertModal from './InsertModal' ;
1010import InsertButton from './InsertButton' ;
1111import DeleteButton from './DeleteButton' ;
@@ -65,10 +65,10 @@ class ToolBar extends Component {
6565 }
6666
6767 displayCommonMessage = ( ) => {
68- this . refs . notifier . notice (
68+ notice (
6969 'error' ,
7070 'Form validate errors, please checking!' ,
71- 'Pressed ESC can cancel ' ) ;
71+ '' ) ;
7272 }
7373
7474 validateNewRow ( newRow ) {
@@ -93,10 +93,10 @@ class ToolBar extends Component {
9393 isValid = false ;
9494 validateState [ column . field ] = tempMsg ;
9595 } else if ( responseType === 'object' && tempMsg . isValid !== true ) {
96- this . refs . notifier . notice (
97- tempMsg . notification . type ,
98- tempMsg . notification . msg ,
99- tempMsg . notification . title ) ;
96+ notice (
97+ tempMsg . notification . type ,
98+ tempMsg . notification . msg ,
99+ tempMsg . notification . title ) ;
100100 isValid = false ;
101101 validateState [ column . field ] = tempMsg . notification . msg ;
102102 }
@@ -122,7 +122,7 @@ class ToolBar extends Component {
122122 }
123123 const msg = this . props . onAddRow ( newRow ) ;
124124 if ( msg ) {
125- this . refs . notifier . notice ( 'error' , msg , 'Pressed ESC can cancel ' ) ;
125+ notice ( 'error' , msg , '' ) ;
126126 this . clearTimeout ( ) ;
127127 // shake form and hack prevent modal hide
128128 this . setState ( {
@@ -321,7 +321,6 @@ class ToolBar extends Component {
321321 return (
322322 < div className = 'row' >
323323 { toolbar }
324- < Notifier ref = 'notifier' />
325324 { modal }
326325 </ div >
327326 ) ;
0 commit comments