diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-13 14:45:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 14:45:46 +0200 |
commit | 537697a6e9757f118d09d9e76362ba1ff617e2c6 (patch) | |
tree | bc55447115e385137684e84697a8c15d2199b8d5 /src/components/util/ErrorBoundary | |
parent | Bumped up version to: 5.6.3-nightly.0 [skip ci] (diff) | |
download | ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.gz ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.zst ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.zip |
chore: upgrade intl dependencies (#1920)
Diffstat (limited to 'src/components/util/ErrorBoundary')
-rw-r--r-- | src/components/util/ErrorBoundary/index.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/components/util/ErrorBoundary/index.js b/src/components/util/ErrorBoundary/index.js index 5db0db226..9c789e981 100644 --- a/src/components/util/ErrorBoundary/index.js +++ b/src/components/util/ErrorBoundary/index.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import injectSheet from 'react-jss'; | 3 | import injectSheet from 'react-jss'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | 5 | ||
6 | import Button from '../../ui/Button'; | 6 | import Button from '../../ui/Button'; |
7 | 7 | ||
@@ -10,26 +10,23 @@ import styles from './styles'; | |||
10 | const messages = defineMessages({ | 10 | const messages = defineMessages({ |
11 | headline: { | 11 | headline: { |
12 | id: 'app.errorHandler.headline', | 12 | id: 'app.errorHandler.headline', |
13 | defaultMessage: '!!!Something went wrong.', | 13 | defaultMessage: 'Something went wrong.', |
14 | }, | 14 | }, |
15 | action: { | 15 | action: { |
16 | id: 'app.errorHandler.action', | 16 | id: 'app.errorHandler.action', |
17 | defaultMessage: '!!!Reload', | 17 | defaultMessage: 'Reload', |
18 | }, | 18 | }, |
19 | }); | 19 | }); |
20 | 20 | ||
21 | export default @injectSheet(styles) class ErrorBoundary extends Component { | 21 | @injectSheet(styles) |
22 | class ErrorBoundary extends Component { | ||
22 | state = { | 23 | state = { |
23 | hasError: false, | 24 | hasError: false, |
24 | } | 25 | }; |
25 | 26 | ||
26 | static propTypes = { | 27 | static propTypes = { |
27 | classes: PropTypes.object.isRequired, | 28 | classes: PropTypes.object.isRequired, |
28 | children: PropTypes.node.isRequired, | 29 | children: PropTypes.node.isRequired, |
29 | } | ||
30 | |||
31 | static contextTypes = { | ||
32 | intl: intlShape, | ||
33 | }; | 30 | }; |
34 | 31 | ||
35 | componentDidCatch() { | 32 | componentDidCatch() { |
@@ -38,7 +35,7 @@ export default @injectSheet(styles) class ErrorBoundary extends Component { | |||
38 | 35 | ||
39 | render() { | 36 | render() { |
40 | const { classes } = this.props; | 37 | const { classes } = this.props; |
41 | const { intl } = this.context; | 38 | const { intl } = this.props; |
42 | 39 | ||
43 | if (this.state.hasError) { | 40 | if (this.state.hasError) { |
44 | return ( | 41 | return ( |
@@ -58,3 +55,5 @@ export default @injectSheet(styles) class ErrorBoundary extends Component { | |||
58 | return this.props.children; | 55 | return this.props.children; |
59 | } | 56 | } |
60 | } | 57 | } |
58 | |||
59 | export default injectIntl(ErrorBoundary); | ||