You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
4.4 KiB

  1. import React from 'react';
  2. import Column from 'flavours/glitch/features/ui/components/column';
  3. import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim';
  4. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  5. import PropTypes from 'prop-types';
  6. import ImmutablePureComponent from 'react-immutable-pure-component';
  7. const messages = defineMessages({
  8. heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' },
  9. });
  10. @injectIntl
  11. export default class KeyboardShortcuts extends ImmutablePureComponent {
  12. static propTypes = {
  13. intl: PropTypes.object.isRequired,
  14. multiColumn: PropTypes.bool,
  15. };
  16. render () {
  17. const { intl } = this.props;
  18. return (
  19. <Column icon='question' heading={intl.formatMessage(messages.heading)}>
  20. <ColumnBackButtonSlim />
  21. <div className='keyboard-shortcuts scrollable optionally-scrollable'>
  22. <table>
  23. <thead>
  24. <tr>
  25. <th><FormattedMessage id='keyboard_shortcuts.hotkey' defaultMessage='Hotkey' /></th>
  26. <th><FormattedMessage id='keyboard_shortcuts.description' defaultMessage='Description' /></th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <tr>
  31. <td><kbd>r</kbd></td>
  32. <td><FormattedMessage id='keyboard_shortcuts.reply' defaultMessage='to reply' /></td>
  33. </tr>
  34. <tr>
  35. <td><kbd>m</kbd></td>
  36. <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td>
  37. </tr>
  38. <tr>
  39. <td><kbd>p</kbd></td>
  40. <td><FormattedMessage id='keyboard_shortcuts.profile' defaultMessage="to open author's profile" /></td>
  41. </tr>
  42. <tr>
  43. <td><kbd>f</kbd></td>
  44. <td><FormattedMessage id='keyboard_shortcuts.favourite' defaultMessage='to favourite' /></td>
  45. </tr>
  46. <tr>
  47. <td><kbd>b</kbd></td>
  48. <td><FormattedMessage id='keyboard_shortcuts.boost' defaultMessage='to boost' /></td>
  49. </tr>
  50. <tr>
  51. <td><kbd>enter</kbd>, <kbd>o</kbd></td>
  52. <td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
  53. </tr>
  54. <tr>
  55. <td><kbd>x</kbd></td>
  56. <td><FormattedMessage id='keyboard_shortcuts.toggle_hidden' defaultMessage='to show/hide text behind CW' /></td>
  57. </tr>
  58. <tr>
  59. <td><kbd>up</kbd>, <kbd>k</kbd></td>
  60. <td><FormattedMessage id='keyboard_shortcuts.up' defaultMessage='to move up in the list' /></td>
  61. </tr>
  62. <tr>
  63. <td><kbd>down</kbd>, <kbd>j</kbd></td>
  64. <td><FormattedMessage id='keyboard_shortcuts.down' defaultMessage='to move down in the list' /></td>
  65. </tr>
  66. <tr>
  67. <td><kbd>1</kbd>-<kbd>9</kbd></td>
  68. <td><FormattedMessage id='keyboard_shortcuts.column' defaultMessage='to focus a status in one of the columns' /></td>
  69. </tr>
  70. <tr>
  71. <td><kbd>n</kbd></td>
  72. <td><FormattedMessage id='keyboard_shortcuts.compose' defaultMessage='to focus the compose textarea' /></td>
  73. </tr>
  74. <tr>
  75. <td><kbd>alt</kbd>+<kbd>n</kbd></td>
  76. <td><FormattedMessage id='keyboard_shortcuts.toot' defaultMessage='to start a brand new toot' /></td>
  77. </tr>
  78. <tr>
  79. <td><kbd>backspace</kbd></td>
  80. <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></td>
  81. </tr>
  82. <tr>
  83. <td><kbd>s</kbd></td>
  84. <td><FormattedMessage id='keyboard_shortcuts.search' defaultMessage='to focus search' /></td>
  85. </tr>
  86. <tr>
  87. <td><kbd>esc</kbd></td>
  88. <td><FormattedMessage id='keyboard_shortcuts.unfocus' defaultMessage='to un-focus compose textarea/search' /></td>
  89. </tr>
  90. <tr>
  91. <td><kbd>?</kbd></td>
  92. <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. </div>
  97. </Column>
  98. );
  99. }
  100. }