aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-10 10:47:52 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-10 10:47:52 +0530
commit1c3527a84c045af62fa9c44c41a8e7f96742358d (patch)
tree59333df272631a8f5c5a22868ebcc1a19a4713dd /src/components
parentdoc: Updated CHANGELOG.md [skip ci] (diff)
downloadferdium-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')
-rw-r--r--src/components/layout/Sidebar.js7
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';
6import { Link } from 'react-router'; 6import { Link } from 'react-router';
7 7
8import Tabbar from '../services/tabs/Tabbar'; 8import Tabbar from '../services/tabs/Tabbar';
9import { ctrlKey, isMac, shiftKey } from '../../environment'; 9import { ctrlKey, shiftKey, settingsShortcutKey } from '../../environment';
10import { workspaceStore } from '../../features/workspaces'; 10import { workspaceStore } from '../../features/workspaces';
11import { todosStore } from '../../features/todos'; 11import { todosStore } from '../../features/todos';
12import { todoActions } from '../../features/todos/actions'; 12import { todoActions } from '../../features/todos/actions';
13import AppStore from '../../stores/AppStore'; 13import AppStore from '../../stores/AppStore';
14import SettingsStore from '../../stores/SettingsStore'; 14import SettingsStore from '../../stores/SettingsStore';
15 15
16// Platform specific shortcut keys
17const settingsShortcutKey = isMac ? ',' : 'P';
18
19const messages = defineMessages({ 16const 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" />