@ -1,28 +1,11 @@
import React from 'react' ;
import Column from '../ui/components/column' ;
import { defineMessages , injectIntl } from 'react-intl' ;
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' } ,
hotkey : { id : 'keyboard_shortcuts.hotkey' , defaultMessage : 'Hotkey' } ,
description : { id : 'keyboard_shortcuts.description' , defaultMessage : 'Description' } ,
reply : { id : 'keyboard_shortcuts.reply' , defaultMessage : 'to reply' } ,
mention : { id : 'keyboard_shortcuts.mention' , defaultMessage : 'to mention author' } ,
favourite : { id : 'keyboard_shortcuts.favourite' , defaultMessage : 'to favourite' } ,
boost : { id : 'keyboard_shortcuts.boost' , defaultMessage : 'to boost' } ,
enter : { id : 'keyboard_shortcuts.enter' , defaultMessage : 'to open status' } ,
profile : { id : 'keyboard_shortcuts.profile' , defaultMessage : 'to open author\'s profile' } ,
up : { id : 'keyboard_shortcuts.up' , defaultMessage : 'to move up in the list' } ,
down : { id : 'keyboard_shortcuts.down' , defaultMessage : 'to move down in the list' } ,
column : { id : 'keyboard_shortcuts.column' , defaultMessage : 'to focus a status in one of the columns' } ,
compose : { id : 'keyboard_shortcuts.compose' , defaultMessage : 'to focus the compose textarea' } ,
toot : { id : 'keyboard_shortcuts.toot' , defaultMessage : 'to start a brand new toot' } ,
back : { id : 'keyboard_shortcuts.back' , defaultMessage : 'to navigate back' } ,
search : { id : 'keyboard_shortcuts.search' , defaultMessage : 'to focus search' } ,
unfocus : { id : 'keyboard_shortcuts.unfocus' , defaultMessage : 'to un-focus compose textarea/search' } ,
legend : { id : 'keyboard_shortcuts.legend' , defaultMessage : 'to display this legend' } ,
} ) ;
@ injectIntl
@ -41,23 +24,68 @@ export default class KeyboardShortcuts extends ImmutablePureComponent {
< div className = 'keyboard-shortcuts scrollable optionally-scrollable' >
< table >
< thead >
< tr > < th > { intl . formatMessage ( messages . hotkey ) } < / t h > < t h > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . d e s c r i p t i o n ) } < / t h > < / t r >
< tr >
< th > < FormattedMessage id = 'keyboard_shortcuts.hotkey' defaultMessage = 'Hotkey' / > < / t h >
< th > < FormattedMessage id = 'keyboard_shortcuts.description' defaultMessage = 'Description' / > < / t h >
< / t r >
< / t h e a d >
< tbody >
< tr > < td > < code > r < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . r e p l y ) } < / t d > < / t r >
< tr > < td > < code > m < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . m e n t i o n ) } < / t d > < / t r >
< tr > < td > < code > f < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . f a v o u r i t e ) } < / t d > < / t r >
< tr > < td > < code > b < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . b o o s t ) } < / t d > < / t r >
< tr > < td > < code > enter < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . e n t e r ) } < / t d > < / t r >
< tr > < td > < code > up < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . u p ) } < / t d > < / t r >
< tr > < td > < code > down < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . d o w n ) } < / t d > < / t r >
< tr > < td > < code > 1 < / c o d e > - < c o d e > 9 < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . c o l u m n ) } < / t d > < / t r >
< tr > < td > < code > n < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . c o m p o s e ) } < / t d > < / t r >
< tr > < td > < code > alt < / c o d e > + < c o d e > n < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . t o o t ) } < / t d > < / t r >
< tr > < td > < code > backspace < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . b a c k ) } < / t d > < / t r >
< tr > < td > < code > s < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . s e a r c h ) } < / t d > < / t r >
< tr > < td > < code > esc < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . u n f o c u s ) } < / t d > < / t r >
< tr > < td > < code > ? < / c o d e > < / t d > < t d > { i n t l . f o r m a t M e s s a g e ( m e s s a g e s . l e g e n d ) } < / t d > < / t r >
< tr >
< td > < code > r < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.reply' defaultMessage = 'to reply' / > < / t d >
< / t r >
< tr >
< td > < code > m < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.mention' defaultMessage = 'to mention author' / > < / t d >
< / t r >
< tr >
< td > < code > f < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.favourite' defaultMessage = 'to favourite' / > < / t d >
< / t r >
< tr >
< td > < code > b < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.boost' defaultMessage = 'to boost' / > < / t d >
< / t r >
< tr >
< td > < code > enter < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.enter' defaultMessage = 'to open status' / > < / t d >
< / t r >
< tr >
< td > < code > up < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.up' defaultMessage = 'to move up in the list' / > < / t d >
< / t r >
< tr >
< td > < code > down < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.down' defaultMessage = 'to move down in the list' / > < / t d >
< / t r >
< tr >
< td > < code > 1 < / c o d e > - < c o d e > 9 < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.column' defaultMessage = 'to focus a status in one of the columns' / > < / t d >
< / t r >
< tr >
< td > < code > n < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.compose' defaultMessage = 'to focus the compose textarea' / > < / t d >
< / t r >
< tr >
< td > < code > alt < / c o d e > + < c o d e > n < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.toot' defaultMessage = 'to start a brand new toot' / > < / t d >
< / t r >
< tr >
< td > < code > backspace < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.back' defaultMessage = 'to navigate back' / > < / t d >
< / t r >
< tr >
< td > < code > s < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.search' defaultMessage = 'to focus search' / > < / t d >
< / t r >
< tr >
< td > < code > esc < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.unfocus' defaultMessage = 'to un-focus compose textarea/search' / > < / t d >
< / t r >
< tr >
< td > < code > ? < / c o d e > < / t d >
< td > < FormattedMessage id = 'keyboard_shortcuts.legend' defaultMessage = 'to display this legend' / > < / t d >
< / t r >
< / t b o d y >
< / t a b l e >
< / d i v >