From 9042f9a813e8c909e695ffbe20f81c08eef03b7a Mon Sep 17 00:00:00 2001 From: cwm Date: Wed, 20 Dec 2017 09:50:29 -0600 Subject: add keyboard shortcuts to getting started (fixes #275) --- .../glitch/features/keyboard_shortcuts/index.js | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js (limited to 'app/javascript/flavours/glitch/features/keyboard_shortcuts') diff --git a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js new file mode 100644 index 000000000..0a1273764 --- /dev/null +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js @@ -0,0 +1,102 @@ +import React from 'react'; +import Column from 'flavours/glitch/features/ui/components/column'; +import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; + +const messages = defineMessages({ + heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' }, +}); + +@injectIntl +export default class KeyboardShortcuts extends ImmutablePureComponent { + + static propTypes = { + intl: PropTypes.object.isRequired, + multiColumn: PropTypes.bool, + }; + + render () { + const { intl } = this.props; + + return ( + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
r
m
f
b
enter
up
down
1-9
n
alt+n
backspace
s
esc
x
?
+
+
+ ); + } + +} -- cgit From d736739e8ff79044be6f605cd28c89ead710aec6 Mon Sep 17 00:00:00 2001 From: cwm Date: Thu, 21 Dec 2017 13:04:40 -0600 Subject: instead of in KeyboardShortcuts component (tootsuite pr #6049) --- .../glitch/features/keyboard_shortcuts/index.js | 30 +++++++++++----------- .../flavours/glitch/styles/components/index.scss | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app/javascript/flavours/glitch/features/keyboard_shortcuts') diff --git a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js index 0a1273764..8aed471f2 100644 --- a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js @@ -33,63 +33,63 @@ export default class KeyboardShortcuts extends ImmutablePureComponent { - r + r - m + m - f + f - b + b - enter + enter - up + up - down + down - 1-9 + 1-9 - n + n - alt+n + alt+n - backspace + backspace - s + s - esc + esc - x + x - ? + ? diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index 06521d708..35f308b2d 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -2310,7 +2310,7 @@ padding: 0 10px 8px; } - code { + kbd { display: inline-block; padding: 3px 5px; background-color: lighten($ui-base-color, 8%); -- cgit