diff options
author | 2022-11-19 15:21:09 +0530 | |
---|---|---|
committer | 2022-11-19 09:51:09 +0000 | |
commit | a051331680b21f20201a47601d69505a4cfa9e40 (patch) | |
tree | f98dd4bc668c9814d58c0e49170aeeb19c2fe1de /src/components/services/content/ErrorHandlers/WebviewErrorHandler.js | |
parent | 6.2.1-nightly.46 [skip ci] (diff) | |
download | ferdium-app-a051331680b21f20201a47601d69505a4cfa9e40.tar.gz ferdium-app-a051331680b21f20201a47601d69505a4cfa9e40.tar.zst ferdium-app-a051331680b21f20201a47601d69505a4cfa9e40.zip |
Transform service components to ts (#778)
Diffstat (limited to 'src/components/services/content/ErrorHandlers/WebviewErrorHandler.js')
-rw-r--r-- | src/components/services/content/ErrorHandlers/WebviewErrorHandler.js | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js b/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js deleted file mode 100644 index a658bec8b..000000000 --- a/src/components/services/content/ErrorHandlers/WebviewErrorHandler.js +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import { defineMessages, injectIntl } from 'react-intl'; | ||
5 | import injectSheet from 'react-jss'; | ||
6 | |||
7 | import Button from '../../../ui/button'; | ||
8 | |||
9 | import styles from './styles'; | ||
10 | import { H1 } from '../../../ui/headline'; | ||
11 | |||
12 | const messages = defineMessages({ | ||
13 | headline: { | ||
14 | id: 'service.errorHandler.headline', | ||
15 | defaultMessage: 'Oh no!', | ||
16 | }, | ||
17 | text: { | ||
18 | id: 'service.errorHandler.text', | ||
19 | defaultMessage: '{name} has failed to load.', | ||
20 | }, | ||
21 | action: { | ||
22 | id: 'service.errorHandler.action', | ||
23 | defaultMessage: 'Reload {name}', | ||
24 | }, | ||
25 | editAction: { | ||
26 | id: 'service.errorHandler.editAction', | ||
27 | defaultMessage: 'Edit {name}', | ||
28 | }, | ||
29 | errorMessage: { | ||
30 | id: 'service.errorHandler.message', | ||
31 | defaultMessage: 'Error', | ||
32 | }, | ||
33 | }); | ||
34 | |||
35 | class WebviewErrorHandler extends Component { | ||
36 | static propTypes = { | ||
37 | name: PropTypes.string.isRequired, | ||
38 | reload: PropTypes.func.isRequired, | ||
39 | edit: PropTypes.func.isRequired, | ||
40 | errorMessage: PropTypes.string.isRequired, | ||
41 | classes: PropTypes.object.isRequired, | ||
42 | }; | ||
43 | |||
44 | render() { | ||
45 | const { name, reload, edit, errorMessage, classes } = this.props; | ||
46 | const { intl } = this.props; | ||
47 | |||
48 | return ( | ||
49 | <div className={classes.component}> | ||
50 | <H1>{intl.formatMessage(messages.headline)}</H1> | ||
51 | <p>{intl.formatMessage(messages.text, { name })}</p> | ||
52 | <p> | ||
53 | <strong>{intl.formatMessage(messages.errorMessage)}:</strong>{' '} | ||
54 | {errorMessage} | ||
55 | </p> | ||
56 | <div className={classes.buttonContainer}> | ||
57 | <Button | ||
58 | label={intl.formatMessage(messages.editAction, { name })} | ||
59 | buttonType="inverted" | ||
60 | onClick={() => edit()} | ||
61 | /> | ||
62 | <Button | ||
63 | label={intl.formatMessage(messages.action, { name })} | ||
64 | buttonType="inverted" | ||
65 | onClick={() => reload()} | ||
66 | /> | ||
67 | </div> | ||
68 | </div> | ||
69 | ); | ||
70 | } | ||
71 | } | ||
72 | |||
73 | export default injectIntl( | ||
74 | injectSheet(styles, { injectTheme: true })(observer(WebviewErrorHandler)), | ||
75 | ); | ||