diff options
author | 2022-07-07 09:31:50 +0200 | |
---|---|---|
committer | 2022-07-07 09:31:50 +0200 | |
commit | 71c52373f81cace664047edd19d9d289f45a4dff (patch) | |
tree | 69b3f1d45a8b3f1ceab9497ea3c96e9dc18e3166 /src/containers/settings/SettingsWindow.tsx | |
parent | 6.0.0-nightly.91 [skip ci] (diff) | |
download | ferdium-app-71c5237.tar.gz ferdium-app-71c5237.tar.zst ferdium-app-71c5237.zip |
chore: Mobx & React-Router upgrade (#406)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
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, |