Browse Source

feature(better-error-message): Autoclose error message after 10 seconds

renovate/lint-staged-8.x
pajasevi 7 years ago
parent
commit
446308d59d
  1. 6
      app/components/GlobalError/GlobalError.js

6
app/components/GlobalError/GlobalError.js

@ -3,7 +3,10 @@ import PropTypes from 'prop-types'
import { MdClose } from 'react-icons/lib/md'
import styles from './GlobalError.scss'
const GlobalError = ({ error, clearError }) => (
const GlobalError = ({ error, clearError }) => {
setTimeout(clearError, 10000)
return (
<div className={`${styles.container} ${!error && styles.closed}`}>
<div className={styles.content}>
<div className={styles.close} onClick={clearError}>
@ -13,6 +16,7 @@ const GlobalError = ({ error, clearError }) => (
</div>
</div>
)
}
GlobalError.propTypes = {

Loading…
Cancel
Save