THead.js 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react';
  2. import styled, { css } from 'styled-components';
  3. import TableOptions from '../TableOptions';
  4. const THead = styled.thead`
  5. display: flex;
  6. flex-direction: column;
  7. flex: 1 1 auto;
  8. background-color: #f1f1f1;
  9. border-top-right-radius: 12px;
  10. border-top-left-radius: 12px;
  11. tr {
  12. border-bottom: 1px solid #dedede;
  13. }
  14. `;
  15. const Th = styled.th`
  16. display: flex;
  17. justify-content: start;
  18. align-items: center;
  19. ${({ flex }) =>
  20. flex &&
  21. css`
  22. flex: ${`${flex} ${flex}`} 0;
  23. `};
  24. @media only screen and (max-width: 768px) {
  25. flex: 1;
  26. :nth-child(2) {
  27. display: none;
  28. }
  29. }
  30. @media only screen and (max-width: 510px) {
  31. :nth-child(1) {
  32. display: none;
  33. }
  34. }
  35. `;
  36. const TableHead = () => (
  37. <THead>
  38. <TableOptions />
  39. <tr>
  40. <Th flex="2">Original URL</Th>
  41. <Th flex="1">Created</Th>
  42. <Th flex="1">Short URL</Th>
  43. <Th flex="1">Clicks</Th>
  44. </tr>
  45. </THead>
  46. );
  47. export default TableHead;