From 446308d59d66e797d44cb86275ea0ff95d182aa2 Mon Sep 17 00:00:00 2001 From: pajasevi Date: Thu, 28 Dec 2017 22:07:07 +0100 Subject: [PATCH] feature(better-error-message): Autoclose error message after 10 seconds --- app/components/GlobalError/GlobalError.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/components/GlobalError/GlobalError.js b/app/components/GlobalError/GlobalError.js index 75f09a1e..8707296b 100644 --- a/app/components/GlobalError/GlobalError.js +++ b/app/components/GlobalError/GlobalError.js @@ -3,16 +3,20 @@ 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 ( +
+
+
+ +
+

{error}

-

{error}

-
-) + ) +} GlobalError.propTypes = {