mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 09:35:36 +01:00
feature(components): prop-type Link
This commit is contained in:
parent
933a7f37e6
commit
d5be21649a
1 changed files with 12 additions and 1 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue