diff options
Diffstat (limited to 'src/containers/settings/SettingsWindow.tsx')
-rw-r--r-- | src/containers/settings/SettingsWindow.tsx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/containers/settings/SettingsWindow.tsx b/src/containers/settings/SettingsWindow.tsx index 2192a6f69..93bb08c7c 100644 --- a/src/containers/settings/SettingsWindow.tsx +++ b/src/containers/settings/SettingsWindow.tsx | |||
@@ -1,23 +1,20 @@ | |||
1 | import { Component, ReactNode, ReactPortal } from 'react'; | 1 | import { inject, observer } from 'mobx-react'; |
2 | import { Component, ReactPortal } from 'react'; | ||
2 | import ReactDOM from 'react-dom'; | 3 | import ReactDOM from 'react-dom'; |
3 | import { observer, inject } from 'mobx-react'; | 4 | import { Outlet } from 'react-router-dom'; |
4 | 5 | ||
5 | import { StoresProps } from '../../@types/ferdium-components.types'; | 6 | import { StoresProps } from '../../@types/ferdium-components.types'; |
6 | import Layout from '../../components/settings/SettingsLayout'; | ||
7 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; | 7 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; |
8 | import Layout from '../../components/settings/SettingsLayout'; | ||
8 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 9 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
9 | import { workspaceStore } from '../../features/workspaces'; | 10 | import { workspaceStore } from '../../features/workspaces'; |
10 | 11 | ||
11 | interface SettingsContainerProps extends StoresProps { | 12 | class SettingsContainer extends Component<StoresProps> { |
12 | children: ReactNode; | ||
13 | } | ||
14 | |||
15 | class SettingsContainer extends Component<SettingsContainerProps> { | ||
16 | portalRoot: any; | 13 | portalRoot: any; |
17 | 14 | ||
18 | el: HTMLDivElement; | 15 | el: HTMLDivElement; |
19 | 16 | ||
20 | constructor(props: SettingsContainerProps) { | 17 | constructor(props: StoresProps) { |
21 | super(props); | 18 | super(props); |
22 | 19 | ||
23 | this.portalRoot = document.querySelector('#portalContainer'); | 20 | this.portalRoot = document.querySelector('#portalContainer'); |
@@ -33,7 +30,7 @@ class SettingsContainer extends Component<SettingsContainerProps> { | |||
33 | } | 30 | } |
34 | 31 | ||
35 | render(): ReactPortal { | 32 | render(): ReactPortal { |
36 | const { children, stores } = this.props; | 33 | const { stores } = this.props; |
37 | const { closeSettings } = this.props.actions.ui; | 34 | const { closeSettings } = this.props.actions.ui; |
38 | 35 | ||
39 | const navigation = ( | 36 | const navigation = ( |
@@ -46,7 +43,7 @@ class SettingsContainer extends Component<SettingsContainerProps> { | |||
46 | return ReactDOM.createPortal( | 43 | return ReactDOM.createPortal( |
47 | <ErrorBoundary> | 44 | <ErrorBoundary> |
48 | <Layout navigation={navigation} closeSettings={closeSettings}> | 45 | <Layout navigation={navigation} closeSettings={closeSettings}> |
49 | {children} | 46 | <Outlet /> |
50 | </Layout> | 47 | </Layout> |
51 | </ErrorBoundary>, | 48 | </ErrorBoundary>, |
52 | this.el, | 49 | this.el, |