diff options
author | 2021-09-13 14:45:46 +0200 | |
---|---|---|
committer | 2021-09-13 14:45:46 +0200 | |
commit | 537697a6e9757f118d09d9e76362ba1ff617e2c6 (patch) | |
tree | bc55447115e385137684e84697a8c15d2199b8d5 /src/components/services/content/ErrorHandlers/WebviewErrorHandler.js | |
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/services/content/ErrorHandlers/WebviewErrorHandler.js')
-rw-r--r-- | src/components/services/content/ErrorHandlers/WebviewErrorHandler.js | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js b/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js index 36e0ac418..41d84c0b0 100644 --- a/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js +++ b/src/components/services/content/ErrorHandlers/WebviewErrorHandler.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 { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | import injectSheet from 'react-jss'; | 5 | import injectSheet from 'react-jss'; |
6 | 6 | ||
7 | import Button from '../../../ui/Button'; | 7 | import Button from '../../../ui/Button'; |
@@ -11,27 +11,29 @@ import styles from './styles'; | |||
11 | const messages = defineMessages({ | 11 | const messages = defineMessages({ |
12 | headline: { | 12 | headline: { |
13 | id: 'service.errorHandler.headline', | 13 | id: 'service.errorHandler.headline', |
14 | defaultMessage: '!!!Oh no!', | 14 | defaultMessage: 'Oh no!', |
15 | }, | 15 | }, |
16 | text: { | 16 | text: { |
17 | id: 'service.errorHandler.text', | 17 | id: 'service.errorHandler.text', |
18 | defaultMessage: '!!!{name} has failed to load.', | 18 | defaultMessage: '{name} has failed to load.', |
19 | }, | 19 | }, |
20 | action: { | 20 | action: { |
21 | id: 'service.errorHandler.action', | 21 | id: 'service.errorHandler.action', |
22 | defaultMessage: '!!!Reload {name}', | 22 | defaultMessage: 'Reload {name}', |
23 | }, | 23 | }, |
24 | editAction: { | 24 | editAction: { |
25 | id: 'service.errorHandler.editAction', | 25 | id: 'service.errorHandler.editAction', |
26 | defaultMessage: '!!!Edit {name}', | 26 | defaultMessage: 'Edit {name}', |
27 | }, | 27 | }, |
28 | errorMessage: { | 28 | errorMessage: { |
29 | id: 'service.errorHandler.message', | 29 | id: 'service.errorHandler.message', |
30 | defaultMessage: '!!!Error:', | 30 | defaultMessage: 'Error:', |
31 | }, | 31 | }, |
32 | }); | 32 | }); |
33 | 33 | ||
34 | export default @injectSheet(styles) @observer class WebviewErrorHandler extends Component { | 34 | @injectSheet(styles) |
35 | @observer | ||
36 | class WebviewErrorHandler extends Component { | ||
35 | static propTypes = { | 37 | static propTypes = { |
36 | name: PropTypes.string.isRequired, | 38 | name: PropTypes.string.isRequired, |
37 | reload: PropTypes.func.isRequired, | 39 | reload: PropTypes.func.isRequired, |
@@ -40,30 +42,16 @@ export default @injectSheet(styles) @observer class WebviewErrorHandler extends | |||
40 | classes: PropTypes.object.isRequired, | 42 | classes: PropTypes.object.isRequired, |
41 | }; | 43 | }; |
42 | 44 | ||
43 | static contextTypes = { | ||
44 | intl: intlShape, | ||
45 | }; | ||
46 | |||
47 | render() { | 45 | render() { |
48 | const { | 46 | const { name, reload, edit, errorMessage, classes } = this.props; |
49 | name, | 47 | const { intl } = this.props; |
50 | reload, | ||
51 | edit, | ||
52 | errorMessage, | ||
53 | classes, | ||
54 | } = this.props; | ||
55 | const { intl } = this.context; | ||
56 | 48 | ||
57 | return ( | 49 | return ( |
58 | <div className={classes.component}> | 50 | <div className={classes.component}> |
59 | <h1>{intl.formatMessage(messages.headline)}</h1> | 51 | <h1>{intl.formatMessage(messages.headline)}</h1> |
60 | <p>{intl.formatMessage(messages.text, { name })}</p> | 52 | <p>{intl.formatMessage(messages.text, { name })}</p> |
61 | <p> | 53 | <p> |
62 | <strong> | 54 | <strong>{intl.formatMessage(messages.errorMessage)}:</strong>{' '} |
63 | {intl.formatMessage(messages.errorMessage)} | ||
64 | : | ||
65 | </strong> | ||
66 | {' '} | ||
67 | {errorMessage} | 55 | {errorMessage} |
68 | </p> | 56 | </p> |
69 | <div className={classes.buttonContainer}> | 57 | <div className={classes.buttonContainer}> |
@@ -82,3 +70,5 @@ export default @injectSheet(styles) @observer class WebviewErrorHandler extends | |||
82 | ); | 70 | ); |
83 | } | 71 | } |
84 | } | 72 | } |
73 | |||
74 | export default injectIntl(WebviewErrorHandler); | ||