Browse Source

resolve merge conflict

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
5a3c289b72
  1. 19
      app/components/GlobalError/GlobalError.js
  2. 26
      app/components/GlobalError/GlobalError.scss
  3. 3
      app/routes/app/components/App.js
  4. 6
      app/routes/app/containers/AppContainer.js

19
app/components/GlobalError/GlobalError.js

@ -1,18 +1,23 @@
import React from 'react'
import PropTypes from 'prop-types'
import { MdClose } from 'react-icons/lib/md'
import styles from './GlobalError.scss'
const GlobalError = ({ error }) => {
if (!error) { return null }
return (
<div className={styles.container}>
const GlobalError = ({ error, clearError }) => (
<div className={`${styles.container} ${!error && styles.closed}`}>
<div className={styles.content}>
<div className={styles.close} onClick={clearError}>
<MdClose />
</div>
<h2>{error}</h2>
</div>
)
}
</div>
)
GlobalError.propTypes = {
error: PropTypes.string
error: PropTypes.string,
clearError: PropTypes.func.isRequired
}
export default GlobalError

26
app/components/GlobalError/GlobalError.scss

@ -8,17 +8,27 @@
width: 100%;
text-align: center;
padding: 20px;
// height: 0;
transition: all 0.25s ease;
&.active {
height: 100%;
padding: 20px;
&.closed {
max-height: 0;
padding: 0;
}
h2 {
font-size: 20px;
letter-spacing: 1.5px;
font-weight: bold;
.content {
position: relative;
.close {
position: absolute;
top: calc(50% - 8px);
right: 10%;
cursor: pointer;
}
h2 {
font-size: 20px;
letter-spacing: 1.5px;
font-weight: bold;
}
}
}

3
app/routes/app/components/App.js

@ -42,6 +42,7 @@ class App extends Component {
closeForm,
error: { error },
clearError,
children
} = this.props
@ -60,7 +61,7 @@ class App extends Component {
return (
<div>
<GlobalError error={error} />
<GlobalError error={error} clearError={clearError} />
<ModalRoot
modalType={modalType}
modalProps={modalProps}

6
app/routes/app/containers/AppContainer.js

@ -18,6 +18,8 @@ import { createInvoice, fetchInvoice } from 'reducers/invoice'
import { fetchBlockHeight, lndSelectors } from 'reducers/lnd'
import { clearError } from 'reducers/error'
import App from '../components/App'
@ -47,7 +49,11 @@ const mapDispatchToProps = {
createInvoice,
fetchInvoice,
<<<<<<< HEAD
fetchBlockHeight
=======
clearError
>>>>>>> feature(globalerror): clear error
}
const mapStateToProps = state => ({

Loading…
Cancel
Save