diff options
author | 2019-03-26 13:47:54 +0100 | |
---|---|---|
committer | 2019-03-26 13:47:54 +0100 | |
commit | d05a8efffadd926165d516d6efd8c8b893648ebe (patch) | |
tree | c96d3ad7e111c50ffd9054f8728ce204460e2948 /src/components | |
parent | reset api requests when workspace feature is stopped (diff) | |
download | ferdium-app-d05a8efffadd926165d516d6efd8c8b893648ebe.tar.gz ferdium-app-d05a8efffadd926165d516d6efd8c8b893648ebe.tar.zst ferdium-app-d05a8efffadd926165d516d6efd8c8b893648ebe.zip |
hide workspace feature if it is disabled
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/layout/Sidebar.js | 25 | ||||
-rw-r--r-- | src/components/settings/navigation/SettingsNavigation.js | 21 |
2 files changed, 26 insertions, 20 deletions
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index de379875e..f7bacfe0f 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -6,6 +6,7 @@ import { observer } from 'mobx-react'; | |||
6 | 6 | ||
7 | import Tabbar from '../services/tabs/Tabbar'; | 7 | import Tabbar from '../services/tabs/Tabbar'; |
8 | import { ctrlKey } from '../../environment'; | 8 | import { ctrlKey } from '../../environment'; |
9 | import { workspaceStore } from '../../features/workspaces'; | ||
9 | 10 | ||
10 | const messages = defineMessages({ | 11 | const messages = defineMessages({ |
11 | settings: { | 12 | settings: { |
@@ -88,17 +89,19 @@ export default @observer class Sidebar extends Component { | |||
88 | enableToolTip={() => this.enableToolTip()} | 89 | enableToolTip={() => this.enableToolTip()} |
89 | disableToolTip={() => this.disableToolTip()} | 90 | disableToolTip={() => this.disableToolTip()} |
90 | /> | 91 | /> |
91 | <button | 92 | {workspaceStore.isFeatureActive ? ( |
92 | type="button" | 93 | <button |
93 | onClick={() => { | 94 | type="button" |
94 | toggleWorkspaceDrawer(); | 95 | onClick={() => { |
95 | this.updateToolTip(); | 96 | toggleWorkspaceDrawer(); |
96 | }} | 97 | this.updateToolTip(); |
97 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} | 98 | }} |
98 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+Shift+D)`} | 99 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} |
99 | > | 100 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+Shift+D)`} |
100 | <i className="mdi mdi-view-grid" /> | 101 | > |
101 | </button> | 102 | <i className="mdi mdi-view-grid" /> |
103 | </button> | ||
104 | ) : null} | ||
102 | <button | 105 | <button |
103 | type="button" | 106 | type="button" |
104 | onClick={() => { | 107 | onClick={() => { |
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index 3f570f3b6..a0eb7d796 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js | |||
@@ -4,6 +4,7 @@ import { defineMessages, intlShape } from 'react-intl'; | |||
4 | import { inject, observer } from 'mobx-react'; | 4 | import { inject, observer } from 'mobx-react'; |
5 | 5 | ||
6 | import Link from '../../ui/Link'; | 6 | import Link from '../../ui/Link'; |
7 | import { workspaceStore } from '../../../features/workspaces'; | ||
7 | 8 | ||
8 | const messages = defineMessages({ | 9 | const messages = defineMessages({ |
9 | availableServices: { | 10 | availableServices: { |
@@ -68,15 +69,17 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp | |||
68 | {' '} | 69 | {' '} |
69 | <span className="badge">{serviceCount}</span> | 70 | <span className="badge">{serviceCount}</span> |
70 | </Link> | 71 | </Link> |
71 | <Link | 72 | {workspaceStore.isFeatureActive ? ( |
72 | to="/settings/workspaces" | 73 | <Link |
73 | className="settings-navigation__link" | 74 | to="/settings/workspaces" |
74 | activeClassName="is-active" | 75 | className="settings-navigation__link" |
75 | > | 76 | activeClassName="is-active" |
76 | {intl.formatMessage(messages.yourWorkspaces)} | 77 | > |
77 | {' '} | 78 | {intl.formatMessage(messages.yourWorkspaces)} |
78 | <span className="badge">{workspaceCount}</span> | 79 | {' '} |
79 | </Link> | 80 | <span className="badge">{workspaceCount}</span> |
81 | </Link> | ||
82 | ) : null} | ||
80 | <Link | 83 | <Link |
81 | to="/settings/user" | 84 | to="/settings/user" |
82 | className="settings-navigation__link" | 85 | className="settings-navigation__link" |