InfoModal.jsx 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import React from "react";
  2. import { useTranslation, Trans } from "react-i18next";
  3. import styled from "styled-components";
  4. import Modal from "../../ui/Modal";
  5. import GameInformation from "./GameInformation";
  6. const Kbd = styled.kbd`
  7. background-color: #eee;
  8. border-radius: 3px;
  9. border: 1px solid #b4b4b4;
  10. box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
  11. 0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  12. color: #333;
  13. display: inline-block;
  14. font-family: consolas, "Liberation Mono", courier, monospace;
  15. font-size: 0.85em;
  16. font-weight: 700;
  17. line-height: 1;
  18. padding: 2px 4px;
  19. white-space: nowrap;
  20. `;
  21. const InfoModal = ({ show, setShow }) => {
  22. const { t } = useTranslation();
  23. return (
  24. <Modal title={t("Help & info")} setShow={setShow} show={show}>
  25. <GameInformation />
  26. <header>
  27. <h3>{t("Board interactions")}</h3>
  28. </header>
  29. <section>
  30. <Trans i18nKey="helpBoard">
  31. <ul>
  32. <li>
  33. Move the board with middle mouse button click. Alternatively you
  34. can use left button with alt key.
  35. </li>
  36. <li>Zoom with mouse wheel.</li>
  37. <li>
  38. Switch to edit mode with top button to be able to edit the game.
  39. </li>
  40. <li>You can save and reload game by clicking the burger menu.</li>
  41. <li>
  42. Use <Kbd>Ctrl</Kbd> + <Kbd>1</Kbd>-<Kbd>9</Kbd> to save a position
  43. and <Kbd>1</Kbd>-<Kbd>9</Kbd>
  44. to restore it.
  45. </li>
  46. <li>
  47. Use <Kbd>space</Kbd> to zoom temporally to the center of screen.
  48. </li>
  49. </ul>
  50. </Trans>
  51. </section>
  52. <header>
  53. <h3>{t("Item interactions")}</h3>
  54. </header>
  55. <section>
  56. <Trans i18nKey="helpItem">
  57. <ul>
  58. <li>Double click on any item to execute the main action on it.</li>
  59. <li>
  60. Long clic on item to be able to selected previously locked item.
  61. </li>
  62. <li>See other shortcuts in action menu.</li>
  63. </ul>
  64. </Trans>
  65. </section>
  66. <header>
  67. <h3>{t("More information")}</h3>
  68. </header>
  69. <section>
  70. <Trans i18nKey="moreInformation">
  71. <p>
  72. For more information, visit{" "}
  73. <a href="https://github.com/jrmi/airboardgame/">
  74. github repository
  75. </a>
  76. .
  77. </p>
  78. </Trans>
  79. </section>
  80. </Modal>
  81. );
  82. };
  83. export default InfoModal;