diff options
author | 2022-06-27 18:21:31 +0200 | |
---|---|---|
committer | 2022-06-27 17:21:31 +0100 | |
commit | 0bf13689d53bd493fb4d0a4213c1801013b5aa8a (patch) | |
tree | 2b5ae44e4f1aa73b49c011954ff1cb47e3959bad /src/containers/settings/ServicesScreen.js | |
parent | chore: recommend specific vscode extensions to setup development [skip ci] (#... (diff) | |
download | ferdium-app-0bf13689d53bd493fb4d0a4213c1801013b5aa8a.tar.gz ferdium-app-0bf13689d53bd493fb4d0a4213c1801013b5aa8a.tar.zst ferdium-app-0bf13689d53bd493fb4d0a4213c1801013b5aa8a.zip |
chore: transform containers/settings from js to tsx (#384)
Diffstat (limited to 'src/containers/settings/ServicesScreen.js')
-rw-r--r-- | src/containers/settings/ServicesScreen.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/containers/settings/ServicesScreen.js b/src/containers/settings/ServicesScreen.js deleted file mode 100644 index 2970b2a54..000000000 --- a/src/containers/settings/ServicesScreen.js +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | import { RouterStore } from 'mobx-react-router'; | ||
5 | |||
6 | // import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; | ||
7 | import UserStore from '../../stores/UserStore'; | ||
8 | import ServiceStore from '../../stores/ServicesStore'; | ||
9 | |||
10 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; | ||
11 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
12 | |||
13 | class ServicesScreen extends Component { | ||
14 | componentWillUnmount() { | ||
15 | this.props.actions.service.resetFilter(); | ||
16 | this.props.actions.service.resetStatus(); | ||
17 | } | ||
18 | |||
19 | deleteService() { | ||
20 | this.props.actions.service.deleteService(); | ||
21 | this.props.stores.services.resetFilter(); | ||
22 | } | ||
23 | |||
24 | render() { | ||
25 | const { user, services, router } = this.props.stores; | ||
26 | const { toggleService, filter, resetFilter } = this.props.actions.service; | ||
27 | const isLoading = services.allServicesRequest.isExecuting; | ||
28 | |||
29 | let allServices = services.all; | ||
30 | if (services.filterNeedle !== null) { | ||
31 | allServices = services.filtered; | ||
32 | } | ||
33 | |||
34 | return ( | ||
35 | <ErrorBoundary> | ||
36 | <ServicesDashboard | ||
37 | user={user.data} | ||
38 | services={allServices} | ||
39 | status={services.actionStatus} | ||
40 | deleteService={() => this.deleteService()} | ||
41 | toggleService={toggleService} | ||
42 | isLoading={isLoading} | ||
43 | filterServices={filter} | ||
44 | resetFilter={resetFilter} | ||
45 | goTo={router.push} | ||
46 | servicesRequestFailed={ | ||
47 | services.allServicesRequest.wasExecuted && | ||
48 | services.allServicesRequest.isError | ||
49 | } | ||
50 | retryServicesRequest={() => services.allServicesRequest.reload()} | ||
51 | searchNeedle={services.filterNeedle} | ||
52 | /> | ||
53 | </ErrorBoundary> | ||
54 | ); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | ServicesScreen.propTypes = { | ||
59 | stores: PropTypes.shape({ | ||
60 | user: PropTypes.instanceOf(UserStore).isRequired, | ||
61 | services: PropTypes.instanceOf(ServiceStore).isRequired, | ||
62 | router: PropTypes.instanceOf(RouterStore).isRequired, | ||
63 | }).isRequired, | ||
64 | actions: PropTypes.shape({ | ||
65 | service: PropTypes.instanceOf(ServiceStore).isRequired, | ||
66 | }).isRequired, | ||
67 | }; | ||
68 | |||
69 | export default inject('stores', 'actions')(observer(ServicesScreen)); | ||