diff options
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/workspaces/components/WorkspaceDrawer.tsx | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/features/workspaces/components/WorkspaceDrawer.tsx b/src/features/workspaces/components/WorkspaceDrawer.tsx index 2826b741a..cce333b31 100644 --- a/src/features/workspaces/components/WorkspaceDrawer.tsx +++ b/src/features/workspaces/components/WorkspaceDrawer.tsx | |||
@@ -1,6 +1,6 @@ | |||
1 | import { mdiCog, mdiPlusBox } from '@mdi/js'; | 1 | import { mdiCog, mdiPlusBox } from '@mdi/js'; |
2 | import { noop } from 'lodash'; | 2 | import { noop } from 'lodash'; |
3 | import { observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import { Component, type ReactElement } from 'react'; | 4 | import { Component, type ReactElement } from 'react'; |
5 | import { | 5 | import { |
6 | type WrappedComponentProps, | 6 | type WrappedComponentProps, |
@@ -9,6 +9,7 @@ import { | |||
9 | } from 'react-intl'; | 9 | } from 'react-intl'; |
10 | import withStyles, { type WithStylesProps } from 'react-jss'; | 10 | import withStyles, { type WithStylesProps } from 'react-jss'; |
11 | import { Tooltip as ReactTooltip } from 'react-tooltip'; | 11 | import { Tooltip as ReactTooltip } from 'react-tooltip'; |
12 | import type { StoresProps } from 'src/@types/ferdium-components.types'; | ||
12 | import { H1 } from '../../../components/ui/headline'; | 13 | import { H1 } from '../../../components/ui/headline'; |
13 | import Icon from '../../../components/ui/icon'; | 14 | import Icon from '../../../components/ui/icon'; |
14 | import workspaceActions from '../actions'; | 15 | import workspaceActions from '../actions'; |
@@ -92,10 +93,14 @@ const styles = theme => ({ | |||
92 | }, | 93 | }, |
93 | }); | 94 | }); |
94 | 95 | ||
95 | interface IProps extends WithStylesProps<typeof styles>, WrappedComponentProps { | 96 | interface IProps |
97 | extends WithStylesProps<typeof styles>, | ||
98 | WrappedComponentProps, | ||
99 | StoresProps { | ||
96 | getServicesForWorkspace: (workspace: Workspace | null) => string[]; | 100 | getServicesForWorkspace: (workspace: Workspace | null) => string[]; |
97 | } | 101 | } |
98 | 102 | ||
103 | @inject('stores') | ||
99 | @observer | 104 | @observer |
100 | class WorkspaceDrawer extends Component<IProps> { | 105 | class WorkspaceDrawer extends Component<IProps> { |
101 | componentDidMount(): void { | 106 | componentDidMount(): void { |
@@ -115,6 +120,11 @@ class WorkspaceDrawer extends Component<IProps> { | |||
115 | const actualWorkspace = isSwitchingWorkspace | 120 | const actualWorkspace = isSwitchingWorkspace |
116 | ? nextWorkspace | 121 | ? nextWorkspace |
117 | : activeWorkspace; | 122 | : activeWorkspace; |
123 | |||
124 | const { settings } = this.props.stores; | ||
125 | |||
126 | const { hideAllServicesWorkspace } = settings.all.app; | ||
127 | |||
118 | return ( | 128 | return ( |
119 | <div className={`${classes.drawer} workspaces-drawer`}> | 129 | <div className={`${classes.drawer} workspaces-drawer`}> |
120 | <H1 className={classes.headline}> | 130 | <H1 className={classes.headline}> |
@@ -138,16 +148,18 @@ class WorkspaceDrawer extends Component<IProps> { | |||
138 | </span> | 148 | </span> |
139 | </H1> | 149 | </H1> |
140 | <div className={classes.workspaces}> | 150 | <div className={classes.workspaces}> |
141 | <WorkspaceDrawerItem | 151 | {!hideAllServicesWorkspace && ( |
142 | name={intl.formatMessage(messages.allServices)} | 152 | <WorkspaceDrawerItem |
143 | onClick={() => { | 153 | name={intl.formatMessage(messages.allServices)} |
144 | workspaceActions.deactivate(); | 154 | onClick={() => { |
145 | workspaceActions.toggleWorkspaceDrawer(); | 155 | workspaceActions.deactivate(); |
146 | }} | 156 | workspaceActions.toggleWorkspaceDrawer(); |
147 | services={getServicesForWorkspace(null)} | 157 | }} |
148 | isActive={actualWorkspace == null} | 158 | services={getServicesForWorkspace(null)} |
149 | shortcutIndex={0} | 159 | isActive={actualWorkspace == null} |
150 | /> | 160 | shortcutIndex={0} |
161 | /> | ||
162 | )} | ||
151 | {workspaces.map((workspace, index) => ( | 163 | {workspaces.map((workspace, index) => ( |
152 | <WorkspaceDrawerItem | 164 | <WorkspaceDrawerItem |
153 | key={workspace.id} | 165 | key={workspace.id} |