aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar Balaji Vijayakumar <kuttibalaji.v6@gmail.com>2022-10-31 16:14:30 +0530
committerLibravatar GitHub <noreply@github.com>2022-10-31 10:44:30 +0000
commit87bc593ac72af503171f759fc6e4b1e9e0813039 (patch)
tree7128adb5cc48ae36104c4d3e6de219b9de1ac446 /src/components
parentConvert web controls & screen to typescript (#722) (diff)
downloadferdium-app-87bc593ac72af503171f759fc6e4b1e9e0813039.tar.gz
ferdium-app-87bc593ac72af503171f759fc6e4b1e9e0813039.tar.zst
ferdium-app-87bc593ac72af503171f759fc6e4b1e9e0813039.zip
refactor: convert global app to typescript (#723)
Diffstat (limited to 'src/components')
-rw-r--r--src/components/settings/releaseNotes/ReleaseNotesLayout.tsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/components/settings/releaseNotes/ReleaseNotesLayout.tsx b/src/components/settings/releaseNotes/ReleaseNotesLayout.tsx
index ee0ba75a8..00c618913 100644
--- a/src/components/settings/releaseNotes/ReleaseNotesLayout.tsx
+++ b/src/components/settings/releaseNotes/ReleaseNotesLayout.tsx
@@ -1,14 +1,15 @@
1import { Component } from 'react'; 1import { Component } from 'react';
2import { inject, observer } from 'mobx-react'; 2import { inject, observer } from 'mobx-react';
3import { defineMessages, injectIntl } from 'react-intl'; 3import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl';
4 4
5import { mdiClose } from '@mdi/js'; 5import { mdiClose } from '@mdi/js';
6import { Outlet } from 'react-router-dom'; 6import { Outlet } from 'react-router-dom';
7import { StoresProps } from '../../../@types/ferdium-components.types';
8import ErrorBoundary from '../../util/ErrorBoundary'; 7import ErrorBoundary from '../../util/ErrorBoundary';
9import Appear from '../../ui/effects/Appear'; 8import Appear from '../../ui/effects/Appear';
10import Icon from '../../ui/icon'; 9import Icon from '../../ui/icon';
11import { isEscKeyPress } from '../../../jsUtils'; 10import { isEscKeyPress } from '../../../jsUtils';
11import { Actions } from '../../../actions/lib/actions';
12import { RealStores } from '../../../stores';
12 13
13const messages = defineMessages({ 14const messages = defineMessages({
14 closeSettings: { 15 closeSettings: {
@@ -17,10 +18,13 @@ const messages = defineMessages({
17 }, 18 },
18}); 19});
19 20
20interface IProps extends StoresProps { 21interface IProps extends WrappedComponentProps {
21 intl: any; 22 actions?: Actions;
23 stores?: RealStores;
22} 24}
23 25
26@inject('stores', 'actions')
27@observer
24class ReleaseNotesLayout extends Component<IProps> { 28class ReleaseNotesLayout extends Component<IProps> {
25 componentDidMount() { 29 componentDidMount() {
26 document.addEventListener('keydown', this.handleKeyDown.bind(this), false); 30 document.addEventListener('keydown', this.handleKeyDown.bind(this), false);
@@ -37,12 +41,12 @@ class ReleaseNotesLayout extends Component<IProps> {
37 41
38 handleKeyDown(e) { 42 handleKeyDown(e) {
39 if (isEscKeyPress(e.keyCode)) { 43 if (isEscKeyPress(e.keyCode)) {
40 this.props.actions.ui.closeSettings(); 44 this.props.actions!.ui.closeSettings();
41 } 45 }
42 } 46 }
43 47
44 render() { 48 render() {
45 const { closeSettings } = this.props.actions.ui; 49 const { closeSettings } = this.props.actions!.ui;
46 50
47 const { intl } = this.props; 51 const { intl } = this.props;
48 52
@@ -74,6 +78,4 @@ class ReleaseNotesLayout extends Component<IProps> {
74 } 78 }
75} 79}
76 80
77export default injectIntl<'intl', IProps>( 81export default injectIntl<'intl', IProps>(ReleaseNotesLayout);
78 inject('stores', 'actions')(observer(ReleaseNotesLayout)),
79);