aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/settings')
-rw-r--r--src/containers/settings/EditSettingsScreen.tsx3
-rw-r--r--src/containers/settings/ReleaseNotesScreen.tsx16
-rw-r--r--src/containers/settings/ReleaseNotesWindow.tsx42
3 files changed, 60 insertions, 1 deletions
diff --git a/src/containers/settings/EditSettingsScreen.tsx b/src/containers/settings/EditSettingsScreen.tsx
index a6c4561dd..fbbed629a 100644
--- a/src/containers/settings/EditSettingsScreen.tsx
+++ b/src/containers/settings/EditSettingsScreen.tsx
@@ -853,6 +853,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> {
853 const { app } = this.props.stores; 853 const { app } = this.props.stores;
854 const { 854 const {
855 updateStatus, 855 updateStatus,
856 updateVersion,
856 updateStatusTypes, 857 updateStatusTypes,
857 isClearingAllCache, 858 isClearingAllCache,
858 lockingFeatureEnabled, 859 lockingFeatureEnabled,
@@ -860,13 +861,13 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> {
860 const { checkForUpdates, installUpdate, clearAllCache } = 861 const { checkForUpdates, installUpdate, clearAllCache } =
861 this.props.actions.app; 862 this.props.actions.app;
862 const form = this.prepareForm(); 863 const form = this.prepareForm();
863
864 return ( 864 return (
865 <ErrorBoundary> 865 <ErrorBoundary>
866 <EditSettingsForm 866 <EditSettingsForm
867 form={form} 867 form={form}
868 checkForUpdates={checkForUpdates} 868 checkForUpdates={checkForUpdates}
869 installUpdate={installUpdate} 869 installUpdate={installUpdate}
870 updateVersion={updateVersion}
870 isCheckingForUpdates={updateStatus === updateStatusTypes.CHECKING} 871 isCheckingForUpdates={updateStatus === updateStatusTypes.CHECKING}
871 isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE} 872 isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE}
872 noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} 873 noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE}
diff --git a/src/containers/settings/ReleaseNotesScreen.tsx b/src/containers/settings/ReleaseNotesScreen.tsx
new file mode 100644
index 000000000..c3014d187
--- /dev/null
+++ b/src/containers/settings/ReleaseNotesScreen.tsx
@@ -0,0 +1,16 @@
1import { Component, ReactElement } from 'react';
2
3import ReleaseNotes from '../../components/settings/releaseNotes/ReleaseNotesDashboard';
4import ErrorBoundary from '../../components/util/ErrorBoundary';
5
6class ReleaseNotesScreen extends Component {
7 render(): ReactElement {
8 return (
9 <ErrorBoundary>
10 <ReleaseNotes />
11 </ErrorBoundary>
12 );
13 }
14}
15
16export default ReleaseNotesScreen;
diff --git a/src/containers/settings/ReleaseNotesWindow.tsx b/src/containers/settings/ReleaseNotesWindow.tsx
new file mode 100644
index 000000000..3e43727d0
--- /dev/null
+++ b/src/containers/settings/ReleaseNotesWindow.tsx
@@ -0,0 +1,42 @@
1import { inject, observer } from 'mobx-react';
2import { Component, ReactPortal } from 'react';
3import ReactDOM from 'react-dom';
4import { Outlet } from 'react-router-dom';
5
6import { StoresProps } from '../../@types/ferdium-components.types';
7import Layout from '../../components/settings/releaseNotes/ReleaseNotesLayout';
8import ErrorBoundary from '../../components/util/ErrorBoundary';
9
10class SettingsContainer extends Component<StoresProps> {
11 portalRoot: any;
12
13 el: HTMLDivElement;
14
15 constructor(props: StoresProps) {
16 super(props);
17
18 this.portalRoot = document.querySelector('#portalContainer');
19 this.el = document.createElement('div');
20 }
21
22 componentDidMount(): void {
23 this.portalRoot.append(this.el);
24 }
25
26 componentWillUnmount(): void {
27 this.el.remove();
28 }
29
30 render(): ReactPortal {
31 return ReactDOM.createPortal(
32 <ErrorBoundary>
33 <Layout {...this.props}>
34 <Outlet />
35 </Layout>
36 </ErrorBoundary>,
37 this.el,
38 );
39 }
40}
41
42export default inject('stores', 'actions')(observer(SettingsContainer));