diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-10 10:47:52 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-10 10:47:52 +0530 |
commit | 1c3527a84c045af62fa9c44c41a8e7f96742358d (patch) | |
tree | 59333df272631a8f5c5a22868ebcc1a19a4713dd /src/components/layout | |
parent | doc: Updated CHANGELOG.md [skip ci] (diff) | |
download | ferdium-app-1c3527a84c045af62fa9c44c41a8e7f96742358d.tar.gz ferdium-app-1c3527a84c045af62fa9c44c41a8e7f96742358d.tar.zst ferdium-app-1c3527a84c045af62fa9c44c41a8e7f96742358d.zip |
refactor: Removed duplication and added note about why they were slightly different
(shortcut accelerator vs tooltip text)
Diffstat (limited to 'src/components/layout')
-rw-r--r-- | src/components/layout/Sidebar.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 14ab21fb5..a6f5adce8 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -6,16 +6,13 @@ 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, isMac, shiftKey } from '../../environment'; | 9 | import { ctrlKey, shiftKey, settingsShortcutKey } 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'; |
13 | import AppStore from '../../stores/AppStore'; | 13 | import AppStore from '../../stores/AppStore'; |
14 | import SettingsStore from '../../stores/SettingsStore'; | 14 | import SettingsStore from '../../stores/SettingsStore'; |
15 | 15 | ||
16 | // Platform specific shortcut keys | ||
17 | const settingsShortcutKey = isMac ? ',' : 'P'; | ||
18 | |||
19 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
20 | settings: { | 17 | settings: { |
21 | id: 'sidebar.settings', | 18 | id: 'sidebar.settings', |
@@ -216,7 +213,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
216 | type="button" | 213 | type="button" |
217 | onClick={() => openSettings({ path: 'app' })} | 214 | onClick={() => openSettings({ path: 'app' })} |
218 | className="sidebar__button sidebar__button--settings" | 215 | className="sidebar__button sidebar__button--settings" |
219 | data-tip={`${intl.formatMessage(messages.settings)} (${ctrlKey}+${settingsShortcutKey})`} | 216 | data-tip={`${intl.formatMessage(messages.settings)} (${settingsShortcutKey(false)})`} |
220 | > | 217 | > |
221 | {/* TODO: Because of https://github.com/Templarian/MaterialDesign-Webfont/issues/81 bug in @mdi/font in 5.9.55, added `mdi-memory` as a fallback */} | 218 | {/* TODO: Because of https://github.com/Templarian/MaterialDesign-Webfont/issues/81 bug in @mdi/font in 5.9.55, added `mdi-memory` as a fallback */} |
222 | <i className="mdi mdi-settings mdi-memory" /> | 219 | <i className="mdi mdi-settings mdi-memory" /> |