diff options
author | 2021-08-10 19:22:48 +0530 | |
---|---|---|
committer | 2021-08-10 19:56:53 +0530 | |
commit | 9ba6631b9353e408d7cefe85372666f6011d4928 (patch) | |
tree | 6a0fa5c77ee863e40c0c6477990d266fd976069e /src/components/layout/Sidebar.js | |
parent | build: add Ferdi snap package (#1767) (diff) | |
download | ferdium-app-9ba6631b9353e408d7cefe85372666f6011d4928.tar.gz ferdium-app-9ba6631b9353e408d7cefe85372666f6011d4928.tar.zst ferdium-app-9ba6631b9353e408d7cefe85372666f6011d4928.zip |
refactor: Move platform-specific logic for shortcut keys into common location.
Diffstat (limited to 'src/components/layout/Sidebar.js')
-rw-r--r-- | src/components/layout/Sidebar.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index a6f5adce8..a3dbc3539 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -6,7 +6,7 @@ import { inject, observer } from 'mobx-react'; | |||
6 | import { Link } from 'react-router'; | 6 | import { Link } from 'react-router'; |
7 | 7 | ||
8 | import Tabbar from '../services/tabs/Tabbar'; | 8 | import Tabbar from '../services/tabs/Tabbar'; |
9 | import { ctrlKey, shiftKey, settingsShortcutKey } from '../../environment'; | 9 | import { settingsShortcutKey, lockFerdiShortcutKey, todosToggleShortcutKey, workspaceToggleShortcutKey, addNewServiceShortcutKey, muteFerdiShortcutKey } 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 | import { todoActions } from '../../features/todos/actions'; |
@@ -148,7 +148,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
148 | }, | 148 | }, |
149 | }); | 149 | }); |
150 | }} | 150 | }} |
151 | data-tip={`${intl.formatMessage(messages.lockFerdi)} (${ctrlKey}+${shiftKey}+L)`} | 151 | data-tip={`${intl.formatMessage(messages.lockFerdi)} (${lockFerdiShortcutKey(false)})`} |
152 | > | 152 | > |
153 | <i className="mdi mdi-lock" /> | 153 | <i className="mdi mdi-lock" /> |
154 | </button> | 154 | </button> |
@@ -162,7 +162,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
162 | }} | 162 | }} |
163 | disabled={isTodosServiceActive} | 163 | disabled={isTodosServiceActive} |
164 | className={`sidebar__button sidebar__button--todos ${todosStore.isTodosPanelVisible ? 'is-active' : ''}`} | 164 | className={`sidebar__button sidebar__button--todos ${todosStore.isTodosPanelVisible ? 'is-active' : ''}`} |
165 | data-tip={`${intl.formatMessage(todosToggleMessage)} (${ctrlKey}+T)`} | 165 | data-tip={`${intl.formatMessage(todosToggleMessage)} (${todosToggleShortcutKey(false)})`} |
166 | > | 166 | > |
167 | <i className="mdi mdi-check-all" /> | 167 | <i className="mdi mdi-check-all" /> |
168 | </button> | 168 | </button> |
@@ -175,7 +175,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
175 | this.updateToolTip(); | 175 | this.updateToolTip(); |
176 | }} | 176 | }} |
177 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} | 177 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} |
178 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+D)`} | 178 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${workspaceToggleShortcutKey(false)})`} |
179 | > | 179 | > |
180 | <i className="mdi mdi-view-grid" /> | 180 | <i className="mdi mdi-view-grid" /> |
181 | </button> | 181 | </button> |
@@ -187,7 +187,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
187 | this.updateToolTip(); | 187 | this.updateToolTip(); |
188 | }} | 188 | }} |
189 | className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`} | 189 | className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`} |
190 | data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+${shiftKey}+M)`} | 190 | data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${muteFerdiShortcutKey(false)})`} |
191 | > | 191 | > |
192 | <i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} /> | 192 | <i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} /> |
193 | </button> | 193 | </button> |
@@ -195,7 +195,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
195 | type="button" | 195 | type="button" |
196 | onClick={() => openSettings({ path: 'recipes' })} | 196 | onClick={() => openSettings({ path: 'recipes' })} |
197 | className="sidebar__button sidebar__button--new-service" | 197 | className="sidebar__button sidebar__button--new-service" |
198 | data-tip={`${intl.formatMessage(messages.addNewService)} (${ctrlKey}+N)`} | 198 | data-tip={`${intl.formatMessage(messages.addNewService)} (${addNewServiceShortcutKey(false)})`} |
199 | > | 199 | > |
200 | <i className="mdi mdi-plus-box" /> | 200 | <i className="mdi mdi-plus-box" /> |
201 | </button> | 201 | </button> |