insomnia/app/ui/components/settings/shortcuts.js
Gregory Schier f145b968be Fix some minor bugs (#139)
* Keyboard shortcut for hotkeys

* Fixed some small bugs
2017-04-11 14:20:01 -07:00

43 lines
1.2 KiB
JavaScript

import React, {PureComponent} from 'react';
import Hotkey from '../hotkey';
class Shortcuts extends PureComponent {
renderHotkey (name, char, shift, alt) {
return (
<tr>
<td>{name}</td>
<td className="text-right">
<code><Hotkey char={char} shift={shift} alt={alt}/></code>
</td>
</tr>
);
}
render () {
return (
<div>
<table className="table--fancy">
<tbody>
{this.renderHotkey('Switch Requests', 'P')}
{this.renderHotkey('Send Request', 'Enter')}
{this.renderHotkey('New Request', 'N')}
{this.renderHotkey('Duplicate Request', 'D')}
{this.renderHotkey('Show Cookie Manager', 'K')}
{this.renderHotkey('Show Environment Editor', 'E')}
{this.renderHotkey('Focus URL Bar', 'L')}
{this.renderHotkey('Toggle Sidebar', '\\')}
{this.renderHotkey('Show App Preferences', ',')}
{this.renderHotkey('Show Workspace Settings', ',', true)}
{this.renderHotkey('Show Request Settings', ',', true, true)}
{this.renderHotkey('Show Keyboard Shortcuts', '?')}
</tbody>
</table>
</div>
);
}
}
Shortcuts.propTypes = {};
export default Shortcuts;