diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/layout/Sidebar.js | 101 |
1 files changed, 57 insertions, 44 deletions
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 4bc6feb15..729bd35af 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -9,6 +9,7 @@ import Tabbar from '../services/tabs/Tabbar'; | |||
9 | import { ctrlKey } from '../../environment'; | 9 | import { ctrlKey } from '../../environment'; |
10 | import { workspaceStore } from '../../features/workspaces'; | 10 | import { workspaceStore } from '../../features/workspaces'; |
11 | import { todosStore } from '../../features/todos'; | 11 | import { todosStore } from '../../features/todos'; |
12 | import { todoActions } from '../../features/todos/actions'; | ||
12 | 13 | ||
13 | const messages = defineMessages({ | 14 | const messages = defineMessages({ |
14 | settings: { | 15 | settings: { |
@@ -104,51 +105,63 @@ export default @observer class Sidebar extends Component { | |||
104 | enableToolTip={() => this.enableToolTip()} | 105 | enableToolTip={() => this.enableToolTip()} |
105 | disableToolTip={() => this.disableToolTip()} | 106 | disableToolTip={() => this.disableToolTip()} |
106 | /> | 107 | /> |
107 | {todosStore.isFeatureEnabled && todosStore.isFeatureEnabledByUser ? ( | 108 | { isLoggedIn ? ( |
108 | <button | 109 | <> |
109 | type="button" | 110 | {todosStore.isFeatureEnabled && todosStore.isFeatureEnabledByUser ? ( |
110 | onClick={() => { | 111 | <button |
111 | todoActions.toggleTodosPanel(); | 112 | type="button" |
112 | this.updateToolTip(); | 113 | onClick={() => { |
113 | }} | 114 | todoActions.toggleTodosPanel(); |
114 | className="sidebar__button sidebar__button--workspaces" | 115 | this.updateToolTip(); |
115 | data-tip={`${intl.formatMessage(todosToggleMessage)} (${ctrlKey}+T)`} | 116 | }} |
117 | className="sidebar__button sidebar__button--workspaces" | ||
118 | data-tip={`${intl.formatMessage(todosToggleMessage)} (${ctrlKey}+T)`} | ||
119 | > | ||
120 | <i className="mdi mdi-check-all" /> | ||
121 | </button> | ||
122 | ) : null} | ||
123 | {workspaceStore.isFeatureEnabled ? ( | ||
124 | <button | ||
125 | type="button" | ||
126 | onClick={() => { | ||
127 | toggleWorkspaceDrawer(); | ||
128 | this.updateToolTip(); | ||
129 | }} | ||
130 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} | ||
131 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+D)`} | ||
132 | > | ||
133 | <i className="mdi mdi-view-grid" /> | ||
134 | </button> | ||
135 | ) : null} | ||
136 | <button | ||
137 | type="button" | ||
138 | onClick={() => { | ||
139 | toggleMuteApp(); | ||
140 | this.updateToolTip(); | ||
141 | }} | ||
142 | className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`} | ||
143 | data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+Shift+M)`} | ||
144 | > | ||
145 | <i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} /> | ||
146 | </button> | ||
147 | <button | ||
148 | type="button" | ||
149 | onClick={() => openSettings({ path: 'recipes' })} | ||
150 | className="sidebar__button sidebar__button--new-service" | ||
151 | data-tip={`${intl.formatMessage(messages.addNewService)} (${ctrlKey}+N)`} | ||
152 | > | ||
153 | <i className="mdi mdi-plus-box" /> | ||
154 | </button> | ||
155 | </> | ||
156 | ) : ( | ||
157 | <Link | ||
158 | to="/auth/welcome" | ||
159 | className="sidebar__button sidebar__button--new-service" | ||
160 | data-tip="Login" | ||
116 | > | 161 | > |
117 | <i className="mdi mdi-check-all" /> | 162 | <i className="mdi mdi-login-variant" /> |
118 | </button> | 163 | </Link> |
119 | ) : null} | 164 | )} |
120 | {workspaceStore.isFeatureEnabled ? ( | ||
121 | <button | ||
122 | type="button" | ||
123 | onClick={() => { | ||
124 | toggleWorkspaceDrawer(); | ||
125 | this.updateToolTip(); | ||
126 | }} | ||
127 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} | ||
128 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+D)`} | ||
129 | > | ||
130 | <i className="mdi mdi-view-grid" /> | ||
131 | </button> | ||
132 | ) : null} | ||
133 | <button | ||
134 | type="button" | ||
135 | onClick={() => { | ||
136 | toggleMuteApp(); | ||
137 | this.updateToolTip(); | ||
138 | }} | ||
139 | className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`} | ||
140 | data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+Shift+M)`} | ||
141 | > | ||
142 | <i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} /> | ||
143 | </button> | ||
144 | <button | ||
145 | type="button" | ||
146 | onClick={() => openSettings({ path: 'recipes' })} | ||
147 | className="sidebar__button sidebar__button--new-service" | ||
148 | data-tip={`${intl.formatMessage(messages.addNewService)} (${ctrlKey}+N)`} | ||
149 | > | ||
150 | <i className="mdi mdi-plus-box" /> | ||
151 | </button> | ||
152 | <button | 165 | <button |
153 | type="button" | 166 | type="button" |
154 | onClick={() => openSettings({ path: 'app' })} | 167 | onClick={() => openSettings({ path: 'app' })} |