From 94ab470e5cd24b79468dfd667b1edaaf5cf7648c Mon Sep 17 00:00:00 2001 From: pajasevi Date: Thu, 28 Dec 2017 22:05:59 +0100 Subject: [PATCH 1/2] fix(better-error-message): Added max-width for long error messages, adjusted close icon size --- app/components/GlobalError/GlobalError.scss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/components/GlobalError/GlobalError.scss b/app/components/GlobalError/GlobalError.scss index d9fe4b72..05c02847 100644 --- a/app/components/GlobalError/GlobalError.scss +++ b/app/components/GlobalError/GlobalError.scss @@ -24,15 +24,20 @@ .close { position: absolute; - top: calc(50% - 8px); + top: 50%; right: 10%; + transform: translateY(-50%); cursor: pointer; + font-size: 2rem; } h2 { + max-width: 75%; + margin-left: auto; + margin-right: auto; font-size: 20px; letter-spacing: 1.5px; font-weight: bold; } } -} \ No newline at end of file +} From 446308d59d66e797d44cb86275ea0ff95d182aa2 Mon Sep 17 00:00:00 2001 From: pajasevi Date: Thu, 28 Dec 2017 22:07:07 +0100 Subject: [PATCH 2/2] 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 = {