Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1606 | Rev 2197 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1606 Rev 2195
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { connect } from 'react-redux'
2
import { connect } from 'react-redux'
3
import { Container, Typography } from '@mui/material'
-
 
Línea 4... Línea 3...
4
 
3
 
Línea 5... Línea -...
5
import { addNotification } from '@app/redux/notification/notification.actions'
-
 
6
 
-
 
7
import Button from '@app/components/UI/buttons/Buttons'
4
import { addNotification } from '@app/redux/notification/notification.actions'
8
 
5
 
9
class ErrorBoundary extends React.Component {
6
class ErrorBoundary extends React.Component {
10
  constructor(props) {
7
  constructor(props) {
11
    super(props)
8
    super(props)
Línea 20... Línea 17...
20
    console.error('ErrorBoundary caught an error: ', error, errorInfo)
17
    console.error('ErrorBoundary caught an error: ', error, errorInfo)
21
    this.props.addNotification({ style: 'danger', msg: error.message })
18
    this.props.addNotification({ style: 'danger', msg: error.message })
22
  }
19
  }
Línea 23... Línea 20...
23
 
20
 
24
  render() {
-
 
25
    if (this.state.hasError) {
-
 
26
      return (
-
 
27
        <Container>
-
 
28
          <Typography variant='h1'>
-
 
29
            Something went wrong, please reload the page
-
 
30
          </Typography>
-
 
31
 
-
 
32
          <Button
-
 
33
            variant='primary'
-
 
34
            onClick={() => window.location.reload(true)}
-
 
35
          >
-
 
36
            Reload
-
 
37
          </Button>
-
 
38
        </Container>
-
 
39
      )
-
 
40
    }
-
 
41
 
21
  render() {
42
    return this.props.children
22
    return this.props.children
43
  }
23
  }
Línea 44... Línea 24...
44
}
24
}