All files / components/Link Link.js

100% Statements 4/4
100% Branches 3/3
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24        13x                 13x         3x   13x      
import React from 'react';
import { string, oneOf, oneOfType, func } from 'prop-types';
import StyledLink from './StyledLink';
 
const propTypes = {
  /** sizings keys in the theme passed to <TypographyProvider /> */
  sizing: string,
  /** linkTypes keys in the theme passed to <LinkProvider /> */
  linkType: string,
  /** rendered html tag or custom router link component */
  as: oneOfType([oneOf(['a', 'button']), func]),
};
 
const Link = ({
  sizing = 'm',
  linkType: linktype = 'default',
  as = 'a',
  ...rest
}) => <StyledLink sizing={sizing} linktype={linktype} as={as} {...rest} />;
 
Link.propTypes = propTypes;
 
export default Link;