From 1a0968e63b508eb6008e095573e30884dcd4ba85 Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Tue, 22 Jan 2019 11:42:31 +0100 Subject: [PATCH] chore(client/keyboard-shortcuts): simplify modal --- .../KeyboardShortcutsModal.js | 20 ++++--------------- .../src/app/modals/keyboard-shortcuts/View.js | 7 ------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/client/src/app/modals/keyboard-shortcuts/KeyboardShortcutsModal.js b/client/src/app/modals/keyboard-shortcuts/KeyboardShortcutsModal.js index 79148169bd..c7f7daab62 100644 --- a/client/src/app/modals/keyboard-shortcuts/KeyboardShortcutsModal.js +++ b/client/src/app/modals/keyboard-shortcuts/KeyboardShortcutsModal.js @@ -5,28 +5,16 @@ import View from './View'; import getShortcuts from './getShortcuts'; class KeyboardShortcutsModal extends PureComponent { - constructor(props) { - super(props); - - this.state = {}; + getModifierKey() { + return this.props.isMac ? 'Command' : 'Control'; } render() { - - const { - isMac, - onClose, - } = this.props; - - let modifierKey = 'Control'; - - if (isMac) { - modifierKey = 'Command'; - } + const modifierKey = this.getModifierKey(); return ; } } diff --git a/client/src/app/modals/keyboard-shortcuts/View.js b/client/src/app/modals/keyboard-shortcuts/View.js index 4d3f39391a..4b98b42d15 100644 --- a/client/src/app/modals/keyboard-shortcuts/View.js +++ b/client/src/app/modals/keyboard-shortcuts/View.js @@ -8,13 +8,6 @@ import css from './View.less'; class View extends PureComponent { - - constructor(props) { - super(props); - - this.state = {}; - } - render() { const { shortcuts,