diff options
Diffstat (limited to 'src/components/settings/releaseNotes')
-rw-r--r-- | src/components/settings/releaseNotes/ReleaseNotesLayout.tsx | 20 |
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 @@ | |||
1 | import { Component } from 'react'; | 1 | import { Component } from 'react'; |
2 | import { inject, observer } from 'mobx-react'; | 2 | import { inject, observer } from 'mobx-react'; |
3 | import { defineMessages, injectIntl } from 'react-intl'; | 3 | import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; |
4 | 4 | ||
5 | import { mdiClose } from '@mdi/js'; | 5 | import { mdiClose } from '@mdi/js'; |
6 | import { Outlet } from 'react-router-dom'; | 6 | import { Outlet } from 'react-router-dom'; |
7 | import { StoresProps } from '../../../@types/ferdium-components.types'; | ||
8 | import ErrorBoundary from '../../util/ErrorBoundary'; | 7 | import ErrorBoundary from '../../util/ErrorBoundary'; |
9 | import Appear from '../../ui/effects/Appear'; | 8 | import Appear from '../../ui/effects/Appear'; |
10 | import Icon from '../../ui/icon'; | 9 | import Icon from '../../ui/icon'; |
11 | import { isEscKeyPress } from '../../../jsUtils'; | 10 | import { isEscKeyPress } from '../../../jsUtils'; |
11 | import { Actions } from '../../../actions/lib/actions'; | ||
12 | import { RealStores } from '../../../stores'; | ||
12 | 13 | ||
13 | const messages = defineMessages({ | 14 | const messages = defineMessages({ |
14 | closeSettings: { | 15 | closeSettings: { |
@@ -17,10 +18,13 @@ const messages = defineMessages({ | |||
17 | }, | 18 | }, |
18 | }); | 19 | }); |
19 | 20 | ||
20 | interface IProps extends StoresProps { | 21 | interface IProps extends WrappedComponentProps { |
21 | intl: any; | 22 | actions?: Actions; |
23 | stores?: RealStores; | ||
22 | } | 24 | } |
23 | 25 | ||
26 | @inject('stores', 'actions') | ||
27 | @observer | ||
24 | class ReleaseNotesLayout extends Component<IProps> { | 28 | class 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 | ||
77 | export default injectIntl<'intl', IProps>( | 81 | export default injectIntl<'intl', IProps>(ReleaseNotesLayout); |
78 | inject('stores', 'actions')(observer(ReleaseNotesLayout)), | ||
79 | ); | ||