NewGameItem.jsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import React from "react";
  2. import styled from "styled-components";
  3. import { Link } from "react-router-dom";
  4. import { useTranslation } from "react-i18next";
  5. const Game = styled.li`
  6. position: relative;
  7. padding: 0em;
  8. margin: 0px;
  9. & .game-name {
  10. max-width: 80%;
  11. line-height: 1.2em;
  12. overflow: hidden;
  13. margin-bottom: 3px;
  14. margin: 0.2em 0 0.5em 0;
  15. font-size: 2.3vw;
  16. }
  17. & .img-wrapper {
  18. display: block;
  19. position: relative;
  20. width: 100%;
  21. padding-top: 64.5%;
  22. & > span {
  23. background-color: var(--color-blueGrey);
  24. position: absolute;
  25. top: 0;
  26. left: 0;
  27. bottom: 0;
  28. right: 0;
  29. overflow: hidden;
  30. display: flex;
  31. justify-content: center;
  32. border-radius: 5px;
  33. & img {
  34. flex: 0;
  35. }
  36. }
  37. }
  38. @media screen and (max-width: 1024px) {
  39. & {
  40. flex-basis: 45%;
  41. }
  42. & .details {
  43. font-size: 12px;
  44. }
  45. & .game-name {
  46. font-size: 28px;
  47. }
  48. }
  49. @media screen and (max-width: 640px) {
  50. & {
  51. flex-basis: 100%;
  52. }
  53. & .game-name {
  54. font-size: 24px;
  55. }
  56. }
  57. `;
  58. const GameListItem = () => {
  59. const { t } = useTranslation();
  60. return (
  61. <Game>
  62. <Link to={"/game/"} className="img-wrapper">
  63. <span>
  64. <img
  65. src={
  66. "https://icongr.am/entypo/squared-plus.svg?size=128&color=f9fbfa"
  67. }
  68. alt={t("Create a new game")}
  69. title={t("Create a new game")}
  70. />
  71. </span>
  72. </Link>
  73. <div className="details">
  74. <span></span>
  75. </div>
  76. <h2 className="game-name">{t("Create a new game")}</h2>
  77. </Game>
  78. );
  79. };
  80. export default GameListItem;