THead.tsx 1014 B

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