TBodyButton.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React, { FC } from 'react';
  2. import styled, { css } from 'styled-components';
  3. interface Props {
  4. withText?: boolean;
  5. }
  6. const Button = styled.button<Props>`
  7. display: flex;
  8. justify-content: center;
  9. align-items: center;
  10. width: 26px;
  11. height: 26px;
  12. margin: 0 12px 0 2px;
  13. padding: 0;
  14. border: none;
  15. outline: none;
  16. border-radius: 100%;
  17. box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
  18. background-color: #dedede;
  19. cursor: pointer;
  20. transition: all 0.2s ease-out;
  21. @media only screen and (max-width: 768px) {
  22. height: 22px;
  23. width: 22px;
  24. margin: 0 8px 0 2px;
  25. img {
  26. width: 10px;
  27. height: 10px;
  28. }
  29. }
  30. ${({ withText }) =>
  31. withText &&
  32. css`
  33. width: auto;
  34. padding: 0 12px;
  35. border-radius: 100px;
  36. img {
  37. margin: 4px 6px 0 0;
  38. }
  39. @media only screen and (max-width: 768px) {
  40. width: auto;
  41. }
  42. `};
  43. :active,
  44. :focus {
  45. outline: none;
  46. }
  47. :hover {
  48. transform: translateY(-2px);
  49. }
  50. `;
  51. Button.defaultProps = {
  52. withText: null,
  53. };
  54. export default Button;