diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/layout/AppLayout.tsx (renamed from src/components/layout/AppLayout.jsx) | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/src/components/layout/AppLayout.jsx b/src/components/layout/AppLayout.tsx index 685839c0a..c2468e852 100644 --- a/src/components/layout/AppLayout.jsx +++ b/src/components/layout/AppLayout.tsx | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | 2 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, injectIntl } from 'react-intl'; | 3 | import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; |
5 | import { TitleBar } from 'electron-react-titlebar/renderer'; | 4 | import { TitleBar } from 'electron-react-titlebar/renderer'; |
6 | import injectSheet from 'react-jss'; | 5 | import injectSheet, { WithStylesProps } from 'react-jss'; |
7 | import { ipcRenderer } from 'electron'; | 6 | import { ipcRenderer } from 'electron'; |
8 | 7 | ||
9 | import { mdiFlash, mdiPowerPlug } from '@mdi/js'; | 8 | import { mdiFlash, mdiPowerPlug } from '@mdi/js'; |
@@ -16,8 +15,7 @@ import ErrorBoundary from '../util/ErrorBoundary'; | |||
16 | import { updateVersionParse } from '../../helpers/update-helpers'; | 15 | import { updateVersionParse } from '../../helpers/update-helpers'; |
17 | 16 | ||
18 | // import globalMessages from '../../i18n/globalMessages'; | 17 | // import globalMessages from '../../i18n/globalMessages'; |
19 | 18 | import { isMac, isWindows } from '../../environment'; | |
20 | import { isWindows, isMac } from '../../environment'; | ||
21 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; | 19 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; |
22 | import { workspaceStore } from '../../features/workspaces'; | 20 | import { workspaceStore } from '../../features/workspaces'; |
23 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; | 21 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; |
@@ -25,6 +23,7 @@ import Todos from '../../features/todos/containers/TodosScreen'; | |||
25 | import Icon from '../ui/icon'; | 23 | import Icon from '../ui/icon'; |
26 | 24 | ||
27 | import LockedScreen from '../../containers/auth/LockedScreen'; | 25 | import LockedScreen from '../../containers/auth/LockedScreen'; |
26 | import SettingsStore from '../../stores/SettingsStore'; | ||
28 | 27 | ||
29 | const messages = defineMessages({ | 28 | const messages = defineMessages({ |
30 | servicesUpdated: { | 29 | servicesUpdated: { |
@@ -77,24 +76,30 @@ const toggleFullScreen = () => { | |||
77 | ipcRenderer.send('window.toolbar-double-clicked'); | 76 | ipcRenderer.send('window.toolbar-double-clicked'); |
78 | }; | 77 | }; |
79 | 78 | ||
80 | class AppLayout extends Component { | 79 | interface IProps extends WrappedComponentProps, WithStylesProps<typeof styles> { |
81 | static propTypes = { | 80 | settings: SettingsStore; |
82 | classes: PropTypes.object.isRequired, | 81 | updateVersion: string; |
83 | settings: PropTypes.object.isRequired, | 82 | isFullScreen: boolean; |
84 | isFullScreen: PropTypes.bool.isRequired, | 83 | sidebar: React.ReactElement; |
85 | sidebar: PropTypes.element.isRequired, | 84 | workspacesDrawer: React.ReactElement; |
86 | workspacesDrawer: PropTypes.element.isRequired, | 85 | services: React.ReactElement; |
87 | services: PropTypes.element.isRequired, | 86 | showServicesUpdatedInfoBar: boolean; |
88 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, | 87 | appUpdateIsDownloaded: boolean; |
89 | appUpdateIsDownloaded: PropTypes.bool.isRequired, | 88 | authRequestFailed: boolean; |
90 | authRequestFailed: PropTypes.bool.isRequired, | 89 | installAppUpdate: () => void; |
91 | installAppUpdate: PropTypes.func.isRequired, | 90 | showRequiredRequestsError: boolean; |
92 | showRequiredRequestsError: PropTypes.bool.isRequired, | 91 | areRequiredRequestsSuccessful: boolean; |
93 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, | 92 | retryRequiredRequests: () => void; |
94 | retryRequiredRequests: PropTypes.func.isRequired, | 93 | areRequiredRequestsLoading: boolean; |
95 | areRequiredRequestsLoading: PropTypes.bool.isRequired, | 94 | } |
96 | }; | 95 | |
96 | interface IState { | ||
97 | shouldShowAppUpdateInfoBar: boolean; | ||
98 | shouldShowServicesUpdatedInfoBar: boolean; | ||
99 | } | ||
97 | 100 | ||
101 | @observer | ||
102 | class AppLayout extends Component<IProps, IState> { | ||
98 | constructor(props) { | 103 | constructor(props) { |
99 | super(props); | 104 | super(props); |
100 | 105 | ||
@@ -222,5 +227,5 @@ class AppLayout extends Component { | |||
222 | } | 227 | } |
223 | 228 | ||
224 | export default injectIntl( | 229 | export default injectIntl( |
225 | injectSheet(styles, { injectTheme: true })(observer(AppLayout)), | 230 | injectSheet(styles, { injectTheme: true })(AppLayout), |
226 | ); | 231 | ); |