diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-07-19 12:52:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 12:52:31 +0100 |
commit | 3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165 (patch) | |
tree | 6b414b9ef3be7656da1717b0d6def62e95d1fb90 /src/containers/settings | |
parent | fix: remove autoHibernate (diff) | |
download | ferdium-app-3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165.tar.gz ferdium-app-3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165.tar.zst ferdium-app-3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165.zip |
Feature: Add Release Notes (#491)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Co-authored-by: Ricardo Cino <ricardo@cino.io>
Diffstat (limited to 'src/containers/settings')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.tsx | 3 | ||||
-rw-r--r-- | src/containers/settings/ReleaseNotesScreen.tsx | 16 | ||||
-rw-r--r-- | src/containers/settings/ReleaseNotesWindow.tsx | 42 |
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 @@ | |||
1 | import { Component, ReactElement } from 'react'; | ||
2 | |||
3 | import ReleaseNotes from '../../components/settings/releaseNotes/ReleaseNotesDashboard'; | ||
4 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
5 | |||
6 | class ReleaseNotesScreen extends Component { | ||
7 | render(): ReactElement { | ||
8 | return ( | ||
9 | <ErrorBoundary> | ||
10 | <ReleaseNotes /> | ||
11 | </ErrorBoundary> | ||
12 | ); | ||
13 | } | ||
14 | } | ||
15 | |||
16 | export 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 @@ | |||
1 | import { inject, observer } from 'mobx-react'; | ||
2 | import { Component, ReactPortal } from 'react'; | ||
3 | import ReactDOM from 'react-dom'; | ||
4 | import { Outlet } from 'react-router-dom'; | ||
5 | |||
6 | import { StoresProps } from '../../@types/ferdium-components.types'; | ||
7 | import Layout from '../../components/settings/releaseNotes/ReleaseNotesLayout'; | ||
8 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
9 | |||
10 | class 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 | |||
42 | export default inject('stores', 'actions')(observer(SettingsContainer)); | ||