Jack Mallers
7 years ago
4 changed files with 37 additions and 17 deletions
@ -1,18 +1,23 @@ |
|||||
import React from 'react' |
import React from 'react' |
||||
import PropTypes from 'prop-types' |
import PropTypes from 'prop-types' |
||||
|
import { MdClose } from 'react-icons/lib/md' |
||||
import styles from './GlobalError.scss' |
import styles from './GlobalError.scss' |
||||
|
|
||||
const GlobalError = ({ error }) => { |
const GlobalError = ({ error, clearError }) => ( |
||||
if (!error) { return null } |
<div className={`${styles.container} ${!error && styles.closed}`}> |
||||
return ( |
<div className={styles.content}> |
||||
<div className={styles.container}> |
<div className={styles.close} onClick={clearError}> |
||||
|
<MdClose /> |
||||
|
</div> |
||||
<h2>{error}</h2> |
<h2>{error}</h2> |
||||
</div> |
</div> |
||||
) |
</div> |
||||
} |
) |
||||
|
|
||||
|
|
||||
GlobalError.propTypes = { |
GlobalError.propTypes = { |
||||
error: PropTypes.string |
error: PropTypes.string, |
||||
|
clearError: PropTypes.func.isRequired |
||||
} |
} |
||||
|
|
||||
export default GlobalError |
export default GlobalError |
||||
|
Loading…
Reference in new issue