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/SettingsWindow.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/SettingsWindow.js')
-rw-r--r-- | src/containers/settings/SettingsWindow.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/containers/settings/SettingsWindow.js b/src/containers/settings/SettingsWindow.js deleted file mode 100644 index 0e6ce4df3..000000000 --- a/src/containers/settings/SettingsWindow.js +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import ReactDOM from 'react-dom'; | ||
3 | import PropTypes from 'prop-types'; | ||
4 | import { observer, inject } from 'mobx-react'; | ||
5 | |||
6 | import ServicesStore from '../../stores/ServicesStore'; | ||
7 | |||
8 | import Layout from '../../components/settings/SettingsLayout'; | ||
9 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; | ||
10 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
11 | import { workspaceStore } from '../../features/workspaces'; | ||
12 | import UIStore from '../../stores/UIStore'; | ||
13 | |||
14 | class SettingsContainer extends Component { | ||
15 | portalRoot = document.querySelector('#portalContainer'); | ||
16 | |||
17 | el = document.createElement('div'); | ||
18 | |||
19 | componentDidMount() { | ||
20 | this.portalRoot.append(this.el); | ||
21 | } | ||
22 | |||
23 | componentWillUnmount() { | ||
24 | this.el.remove(); | ||
25 | } | ||
26 | |||
27 | render() { | ||
28 | const { children, stores } = this.props; | ||
29 | const { closeSettings } = this.props.actions.ui; | ||
30 | |||
31 | const navigation = ( | ||
32 | <Navigation | ||
33 | serviceCount={stores.services.all.length} | ||
34 | workspaceCount={workspaceStore.workspaces.length} | ||
35 | /> | ||
36 | ); | ||
37 | |||
38 | return ReactDOM.createPortal( | ||
39 | <ErrorBoundary> | ||
40 | <Layout navigation={navigation} closeSettings={closeSettings}> | ||
41 | {children} | ||
42 | </Layout> | ||
43 | </ErrorBoundary>, | ||
44 | this.el, | ||
45 | ); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | SettingsContainer.propTypes = { | ||
50 | children: PropTypes.element.isRequired, | ||
51 | stores: PropTypes.shape({ | ||
52 | services: PropTypes.instanceOf(ServicesStore).isRequired, | ||
53 | }).isRequired, | ||
54 | actions: PropTypes.shape({ | ||
55 | ui: PropTypes.instanceOf(UIStore).isRequired, | ||
56 | }).isRequired, | ||
57 | }; | ||
58 | |||
59 | export default inject('stores', 'actions')(observer(SettingsContainer)); | ||