Browse Source

Merge pull request #140 from pajasevi/feature/better-error-message

Error message enhancements
renovate/lint-staged-8.x
JimmyMow 7 years ago
committed by GitHub
parent
commit
22e363afaa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/components/GlobalError/GlobalError.js
  2. 7
      app/components/GlobalError/GlobalError.scss

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 = {

7
app/components/GlobalError/GlobalError.scss

@ -24,12 +24,17 @@
.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;

Loading…
Cancel
Save