balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

index.js (869B)


      1 import {__} from '@wordpress/i18n';
      2 import {compose} from '@wordpress/compose';
      3 import {withDispatch} from '@wordpress/data';
      4 import {Notice} from '@wordpress/components';
      5 
      6 import './style.scss';
      7 
      8 export function ErrorNotice(props) {
      9     const {discardAllErrorMessages, errorMessages} = props;
     10     return (
     11         <div className='redux-templates-error-notice'>
     12             <Notice status="error" onRemove={discardAllErrorMessages}>
     13                 <p>
     14                     {
     15                         errorMessages.join(', ')
     16                     }
     17                 </p>
     18             </Notice>
     19         </div>
     20     );
     21 
     22 }
     23 
     24 
     25 export default compose([
     26     withDispatch((dispatch) => {
     27         const {
     28             discardAllErrorMessages
     29         } = dispatch('redux-templates/sectionslist');
     30 
     31         return {
     32             discardAllErrorMessages
     33         };
     34     })
     35 ])(ErrorNotice);