logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

index.js (4041B)


  1. import React from 'react';
  2. import Column from '../ui/components/column';
  3. import ColumnBackButtonSlim from '../../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>f</kbd></td>
  40. <td><FormattedMessage id='keyboard_shortcuts.favourite' defaultMessage='to favourite' /></td>
  41. </tr>
  42. <tr>
  43. <td><kbd>b</kbd></td>
  44. <td><FormattedMessage id='keyboard_shortcuts.boost' defaultMessage='to boost' /></td>
  45. </tr>
  46. <tr>
  47. <td><kbd>enter</kbd></td>
  48. <td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
  49. </tr>
  50. <tr>
  51. <td><kbd>up</kbd></td>
  52. <td><FormattedMessage id='keyboard_shortcuts.up' defaultMessage='to move up in the list' /></td>
  53. </tr>
  54. <tr>
  55. <td><kbd>down</kbd></td>
  56. <td><FormattedMessage id='keyboard_shortcuts.down' defaultMessage='to move down in the list' /></td>
  57. </tr>
  58. <tr>
  59. <td><kbd>1</kbd>-<kbd>9</kbd></td>
  60. <td><FormattedMessage id='keyboard_shortcuts.column' defaultMessage='to focus a status in one of the columns' /></td>
  61. </tr>
  62. <tr>
  63. <td><kbd>n</kbd></td>
  64. <td><FormattedMessage id='keyboard_shortcuts.compose' defaultMessage='to focus the compose textarea' /></td>
  65. </tr>
  66. <tr>
  67. <td><kbd>alt</kbd>+<kbd>n</kbd></td>
  68. <td><FormattedMessage id='keyboard_shortcuts.toot' defaultMessage='to start a brand new toot' /></td>
  69. </tr>
  70. <tr>
  71. <td><kbd>backspace</kbd></td>
  72. <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></td>
  73. </tr>
  74. <tr>
  75. <td><kbd>s</kbd></td>
  76. <td><FormattedMessage id='keyboard_shortcuts.search' defaultMessage='to focus search' /></td>
  77. </tr>
  78. <tr>
  79. <td><kbd>esc</kbd></td>
  80. <td><FormattedMessage id='keyboard_shortcuts.unfocus' defaultMessage='to un-focus compose textarea/search' /></td>
  81. </tr>
  82. <tr>
  83. <td><kbd>?</kbd></td>
  84. <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. </div>
  89. </Column>
  90. );
  91. }
  92. }