{prettyHotkey},
key2: {prettyCombo},
}}
{...messages.hotkeySequence}
/>
);
}, []),
)
.reduce(
(finalHotkey, hotkey, i) =>
// For shortcuts with multiple hotkeys, separate each hotkey with a "/" joiner:
// e.g. "Cmd+S Ctrl+S" => "Cmd+S / Ctrl+S"
i === 0 ? [hotkey] : [...finalHotkey, ' / ', hotkey],
[],
)
.map((element, i) => {element});
};
renderDropdownMenu() {
const { currentType } = this.state;
if (!currentType) {
return null;
}
return (
{currentType}
);
}
renderHotkey = (hotkey, i) => (
{hotkey.description}
{this.prettyPrintHotkey(hotkey)}
);
renderHotkeyList() {
const { currentType } = this.state;
if (!currentType) {
return null;
}
const hotkeys = this.hotkeys[currentType];
return {hotkeys.map(this.renderHotkey)}
;
}
render() {
const { isOpen, onRequestClose } = this.props;
const { currentType } = this.state;
if (!currentType) {
return null;
}
return (
}
>
{this.renderDropdownMenu()}
{this.renderHotkeyList()}
);
}
}
export default HotkeyHelpModal;