From 7f206122a29f83166047e819a1f87b8f019bce47 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Fri, 1 Sep 2017 13:38:40 -0400 Subject: [PATCH] add keyboard shortcuts to nav items --- client/components/Nav.jsx | 7 +++++++ .../IDE/components/KeyboardShortcutModal.jsx | 10 ++++----- client/styles/abstracts/_variables.scss | 9 +++++--- client/styles/components/_nav.scss | 21 +++++++++++++++++++ client/utils/metaKey.js | 2 +- 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx index a183b179..ee0bd9ab 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -3,6 +3,10 @@ import { Link } from 'react-router'; import InlineSVG from 'react-inlinesvg'; import classNames from 'classnames'; +import { + metaKeyName, +} from '../utils/metaKey'; + const triangleUrl = require('../images/down-filled-triangle.svg'); const logoUrl = require('../images/p5js-logo-small.svg'); @@ -127,6 +131,7 @@ class Nav extends React.PureComponent { onBlur={this.handleBlur} > Save + {metaKeyName} + s } { this.props.project.id && this.props.user.authenticated && @@ -201,6 +206,7 @@ class Nav extends React.PureComponent { onBlur={this.handleBlur} > Tidy Code + {'\u21E7'} + Tab
  • @@ -210,6 +216,7 @@ class Nav extends React.PureComponent { onBlur={this.handleBlur} > Find + {metaKeyName} + F
  • diff --git a/client/modules/IDE/components/KeyboardShortcutModal.jsx b/client/modules/IDE/components/KeyboardShortcutModal.jsx index 0eb399ca..171a419b 100644 --- a/client/modules/IDE/components/KeyboardShortcutModal.jsx +++ b/client/modules/IDE/components/KeyboardShortcutModal.jsx @@ -8,7 +8,7 @@ function KeyboardShortcutModal() { return (