ALink.tsx 676 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { Box, BoxProps } from "reflexbox/styled-components";
  2. import styled, { css } from "styled-components";
  3. import { ifProp } from "styled-tools";
  4. interface Props extends BoxProps {
  5. href?: string;
  6. title?: string;
  7. target?: string;
  8. rel?: string;
  9. forButton?: boolean;
  10. }
  11. const ALink = styled(Box).attrs({
  12. as: "a"
  13. })<Props>`
  14. cursor: pointer;
  15. color: #2196f3;
  16. border-bottom: 1px dotted transparent;
  17. text-decoration: none;
  18. transition: all 0.2s ease-out;
  19. ${ifProp(
  20. { forButton: false },
  21. css`
  22. :hover {
  23. border-bottom-color: #2196f3;
  24. }
  25. `
  26. )}
  27. `;
  28. ALink.defaultProps = {
  29. pb: "1px",
  30. forButton: false
  31. };
  32. export default ALink;