feature(components): prop-type Link

This commit is contained in:
Alexander Klein 2021-02-16 13:10:34 +01:00
parent 933a7f37e6
commit d5be21649a

View File

@ -1,10 +1,11 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import NextLink from 'next/link'; import NextLink from 'next/link';
import Icon from './Icon'; import Icon from './Icon';
import styles from './Link.module.css'; import styles from './Link.module.css';
export default function Link({ className, icon, children, size, iconRight, ...props }) { function Link({ className, icon, children, size, iconRight, ...props }) {
return ( return (
<NextLink {...props}> <NextLink {...props}>
<a <a
@ -21,3 +22,13 @@ export default function Link({ className, icon, children, size, iconRight, ...pr
</NextLink> </NextLink>
); );
} }
Link.propTypes = {
className: PropTypes.string,
icon: PropTypes.node,
children: PropTypes.node,
size: PropTypes.oneOf(['large', 'small', 'xsmall']),
iconRight: PropTypes.bool,
};
export default Link;