index.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import React from 'react';
  2. import Column from 'mastodon/components/column';
  3. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  4. import PropTypes from 'prop-types';
  5. import ImmutablePureComponent from 'react-immutable-pure-component';
  6. import ColumnHeader from 'mastodon/components/column_header';
  7. import { Helmet } from 'react-helmet';
  8. const messages = defineMessages({
  9. heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' },
  10. });
  11. export default @injectIntl
  12. class KeyboardShortcuts extends ImmutablePureComponent {
  13. static propTypes = {
  14. intl: PropTypes.object.isRequired,
  15. multiColumn: PropTypes.bool,
  16. };
  17. render () {
  18. const { intl, multiColumn } = this.props;
  19. return (
  20. <Column>
  21. <ColumnHeader
  22. title={intl.formatMessage(messages.heading)}
  23. icon='question'
  24. multiColumn={multiColumn}
  25. />
  26. <div className='keyboard-shortcuts scrollable optionally-scrollable'>
  27. <table>
  28. <thead>
  29. <tr>
  30. <th><FormattedMessage id='keyboard_shortcuts.hotkey' defaultMessage='Hotkey' /></th>
  31. <th><FormattedMessage id='keyboard_shortcuts.description' defaultMessage='Description' /></th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. <tr>
  36. <td><kbd>r</kbd></td>
  37. <td><FormattedMessage id='keyboard_shortcuts.reply' defaultMessage='to reply' /></td>
  38. </tr>
  39. <tr>
  40. <td><kbd>m</kbd></td>
  41. <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td>
  42. </tr>
  43. <tr>
  44. <td><kbd>p</kbd></td>
  45. <td><FormattedMessage id='keyboard_shortcuts.profile' defaultMessage="to open author's profile" /></td>
  46. </tr>
  47. <tr>
  48. <td><kbd>f</kbd></td>
  49. <td><FormattedMessage id='keyboard_shortcuts.favourite' defaultMessage='to favourite' /></td>
  50. </tr>
  51. <tr>
  52. <td><kbd>b</kbd></td>
  53. <td><FormattedMessage id='keyboard_shortcuts.boost' defaultMessage='to boost' /></td>
  54. </tr>
  55. <tr>
  56. <td><kbd>enter</kbd>, <kbd>o</kbd></td>
  57. <td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
  58. </tr>
  59. <tr>
  60. <td><kbd>e</kbd></td>
  61. <td><FormattedMessage id='keyboard_shortcuts.open_media' defaultMessage='to open media' /></td>
  62. </tr>
  63. <tr>
  64. <td><kbd>x</kbd></td>
  65. <td><FormattedMessage id='keyboard_shortcuts.toggle_hidden' defaultMessage='to show/hide text behind CW' /></td>
  66. </tr>
  67. <tr>
  68. <td><kbd>h</kbd></td>
  69. <td><FormattedMessage id='keyboard_shortcuts.toggle_sensitivity' defaultMessage='to show/hide media' /></td>
  70. </tr>
  71. <tr>
  72. <td><kbd>up</kbd>, <kbd>k</kbd></td>
  73. <td><FormattedMessage id='keyboard_shortcuts.up' defaultMessage='to move up in the list' /></td>
  74. </tr>
  75. <tr>
  76. <td><kbd>down</kbd>, <kbd>j</kbd></td>
  77. <td><FormattedMessage id='keyboard_shortcuts.down' defaultMessage='to move down in the list' /></td>
  78. </tr>
  79. <tr>
  80. <td><kbd>1</kbd>-<kbd>9</kbd></td>
  81. <td><FormattedMessage id='keyboard_shortcuts.column' defaultMessage='to focus a status in one of the columns' /></td>
  82. </tr>
  83. <tr>
  84. <td><kbd>n</kbd></td>
  85. <td><FormattedMessage id='keyboard_shortcuts.compose' defaultMessage='to focus the compose textarea' /></td>
  86. </tr>
  87. <tr>
  88. <td><kbd>alt</kbd>+<kbd>n</kbd></td>
  89. <td><FormattedMessage id='keyboard_shortcuts.toot' defaultMessage='to start a brand new post' /></td>
  90. </tr>
  91. <tr>
  92. <td><kbd>alt</kbd>+<kbd>x</kbd></td>
  93. <td><FormattedMessage id='keyboard_shortcuts.spoilers' defaultMessage='to show/hide CW field' /></td>
  94. </tr>
  95. <tr>
  96. <td><kbd>backspace</kbd></td>
  97. <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></td>
  98. </tr>
  99. <tr>
  100. <td><kbd>s</kbd></td>
  101. <td><FormattedMessage id='keyboard_shortcuts.search' defaultMessage='to focus search' /></td>
  102. </tr>
  103. <tr>
  104. <td><kbd>esc</kbd></td>
  105. <td><FormattedMessage id='keyboard_shortcuts.unfocus' defaultMessage='to un-focus compose textarea/search' /></td>
  106. </tr>
  107. <tr>
  108. <td><kbd>g</kbd>+<kbd>h</kbd></td>
  109. <td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td>
  110. </tr>
  111. <tr>
  112. <td><kbd>g</kbd>+<kbd>n</kbd></td>
  113. <td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td>
  114. </tr>
  115. <tr>
  116. <td><kbd>g</kbd>+<kbd>l</kbd></td>
  117. <td><FormattedMessage id='keyboard_shortcuts.local' defaultMessage='to open local timeline' /></td>
  118. </tr>
  119. <tr>
  120. <td><kbd>g</kbd>+<kbd>t</kbd></td>
  121. <td><FormattedMessage id='keyboard_shortcuts.federated' defaultMessage='to open federated timeline' /></td>
  122. </tr>
  123. <tr>
  124. <td><kbd>g</kbd>+<kbd>d</kbd></td>
  125. <td><FormattedMessage id='keyboard_shortcuts.direct' defaultMessage='to open direct messages column' /></td>
  126. </tr>
  127. <tr>
  128. <td><kbd>g</kbd>+<kbd>s</kbd></td>
  129. <td><FormattedMessage id='keyboard_shortcuts.start' defaultMessage='to open "get started" column' /></td>
  130. </tr>
  131. <tr>
  132. <td><kbd>g</kbd>+<kbd>f</kbd></td>
  133. <td><FormattedMessage id='keyboard_shortcuts.favourites' defaultMessage='to open favourites list' /></td>
  134. </tr>
  135. <tr>
  136. <td><kbd>g</kbd>+<kbd>p</kbd></td>
  137. <td><FormattedMessage id='keyboard_shortcuts.pinned' defaultMessage='to open pinned posts list' /></td>
  138. </tr>
  139. <tr>
  140. <td><kbd>g</kbd>+<kbd>u</kbd></td>
  141. <td><FormattedMessage id='keyboard_shortcuts.my_profile' defaultMessage='to open your profile' /></td>
  142. </tr>
  143. <tr>
  144. <td><kbd>g</kbd>+<kbd>b</kbd></td>
  145. <td><FormattedMessage id='keyboard_shortcuts.blocked' defaultMessage='to open blocked users list' /></td>
  146. </tr>
  147. <tr>
  148. <td><kbd>g</kbd>+<kbd>m</kbd></td>
  149. <td><FormattedMessage id='keyboard_shortcuts.muted' defaultMessage='to open muted users list' /></td>
  150. </tr>
  151. <tr>
  152. <td><kbd>g</kbd>+<kbd>r</kbd></td>
  153. <td><FormattedMessage id='keyboard_shortcuts.requests' defaultMessage='to open follow requests list' /></td>
  154. </tr>
  155. <tr>
  156. <td><kbd>?</kbd></td>
  157. <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. </div>
  162. <Helmet>
  163. <meta name='robots' content='noindex' />
  164. </Helmet>
  165. </Column>
  166. );
  167. }
  168. }