2016-09-07 21:47:22 +00:00
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
import InlineSVG from 'react-inlinesvg';
|
2017-02-22 19:29:35 +00:00
|
|
|
|
2017-06-06 19:20:21 +00:00
|
|
|
import {
|
|
|
|
metaKeyName,
|
|
|
|
} from '../../../utils/metaKey';
|
|
|
|
|
2016-09-07 21:47:22 +00:00
|
|
|
const exitUrl = require('../../../images/exit.svg');
|
|
|
|
|
2016-09-08 01:48:45 +00:00
|
|
|
class KeyboardShortcutModal extends React.Component {
|
|
|
|
componentDidMount() {
|
|
|
|
this.isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<section className="keyboard-shortcuts">
|
|
|
|
<header className="keyboard-shortcuts__header">
|
|
|
|
<h2>Keyboard Shortcuts</h2>
|
|
|
|
<button className="keyboard-shortcuts__close" onClick={this.props.closeModal}>
|
|
|
|
<InlineSVG src={exitUrl} alt="Close Keyboard Shortcuts Overlay" />
|
|
|
|
</button>
|
|
|
|
</header>
|
2016-11-08 17:39:46 +00:00
|
|
|
<ul title="keyboard shortcuts">
|
2016-09-08 01:48:45 +00:00
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">Shift + Tab</span>
|
|
|
|
<span>Tidy</span>
|
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + S
|
2016-09-08 01:48:45 +00:00
|
|
|
</span>
|
|
|
|
<span>Save</span>
|
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
2016-09-28 19:17:29 +00:00
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + F
|
|
|
|
</span>
|
|
|
|
<span>Find Text</span>
|
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
|
|
|
{metaKeyName} + G
|
|
|
|
</span>
|
|
|
|
<span>Find Next Text Match</span>
|
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
|
|
|
{metaKeyName} + Shift + G
|
|
|
|
</span>
|
|
|
|
<span>Find Previous Text Match</span>
|
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
|
|
|
{metaKeyName} + [
|
2016-09-28 19:17:29 +00:00
|
|
|
</span>
|
|
|
|
<span>Indent Code Left</span>
|
2016-09-08 01:48:45 +00:00
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
2016-09-28 19:17:29 +00:00
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + ]
|
2016-09-28 19:17:29 +00:00
|
|
|
</span>
|
|
|
|
<span>Indent Code Right</span>
|
2016-09-08 01:48:45 +00:00
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
2016-09-28 19:17:29 +00:00
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + /
|
2016-09-28 19:17:29 +00:00
|
|
|
</span>
|
2016-09-08 01:48:45 +00:00
|
|
|
<span>Comment Line</span>
|
|
|
|
</li>
|
2016-09-28 19:17:29 +00:00
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + Enter
|
|
|
|
</span>
|
2016-09-28 19:17:29 +00:00
|
|
|
<span>Start Sketch</span>
|
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + Shift + Enter
|
2016-09-28 19:17:29 +00:00
|
|
|
</span>
|
|
|
|
<span>Stop Sketch</span>
|
|
|
|
</li>
|
2016-11-08 17:39:46 +00:00
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + Shift + 1
|
2016-11-08 17:39:46 +00:00
|
|
|
</span>
|
2016-11-12 16:53:02 +00:00
|
|
|
<span>Toggle Text-based Canvas</span>
|
2016-11-08 17:39:46 +00:00
|
|
|
</li>
|
|
|
|
<li className="keyboard-shortcut-item">
|
|
|
|
<span className="keyboard-shortcut__command">
|
2017-06-06 19:20:21 +00:00
|
|
|
{metaKeyName} + Shift + 2
|
2016-11-08 17:39:46 +00:00
|
|
|
</span>
|
|
|
|
<span>Turn Off Text-based Canvas</span>
|
|
|
|
</li>
|
2016-09-08 01:48:45 +00:00
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
}
|
2016-09-07 21:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
KeyboardShortcutModal.propTypes = {
|
|
|
|
closeModal: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default KeyboardShortcutModal;
|