docbrown/app/javascript/article-form/elements/errors.jsx
Tamas Fodor 0d2506f9ef Fix eslint issues in article-form's jsx files (#4217)
* fix eslint issues in article-form's jsx files

* Use e.key instead of deprecated e.keyCode

* Put back whitespace but in html format

* use re-usable SetupImageButton comp, use window.confirm, put back console.log temporarily

* import deep

* fix CoverImage className prop issue

* update jest snap files

* remove no-restricted-globals from eslint-disable-next-line
2019-10-19 17:09:06 -04:00

30 lines
584 B
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
const Errors = ({ errorsList }) => (
<div className="articleform__errors">
<h2>
<span role="img" aria-label="face screaming in fear">
😱
</span>
&nbsp; Heads up:
</h2>
<ul>
{Object.keys(errorsList).map(key => {
return (
<li>
{key}
: &nbsp;
{errorsList[key]}
</li>
);
})}
</ul>
</div>
);
Errors.propTypes = {
errorsList: PropTypes.objectOf(PropTypes.string).isRequired,
};
export default Errors;