SidebarNavigationLink: add jsdoc comments
This commit is contained in:
parent
2bd468358b
commit
d0ecdae9f3
|
@ -5,13 +5,19 @@ import { NavLink } from 'react-router-dom';
|
||||||
import { Icon, Text, Counter } from './ui';
|
import { Icon, Text, Counter } from './ui';
|
||||||
|
|
||||||
interface ISidebarNavigationLink {
|
interface ISidebarNavigationLink {
|
||||||
|
/** Notification count, if any. */
|
||||||
count?: number,
|
count?: number,
|
||||||
|
/** URL to an SVG icon. */
|
||||||
icon: string,
|
icon: string,
|
||||||
text: string | React.ReactElement,
|
/** Link label. */
|
||||||
|
text: React.ReactElement,
|
||||||
|
/** Route to an internal page. */
|
||||||
to?: string,
|
to?: string,
|
||||||
|
/** Callback when the link is clicked. */
|
||||||
onClick?: React.EventHandler<React.MouseEvent>,
|
onClick?: React.EventHandler<React.MouseEvent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Desktop sidebar navigation link. */
|
||||||
const SidebarNavigationLink = React.forwardRef((props: ISidebarNavigationLink, ref: React.ForwardedRef<HTMLAnchorElement>): JSX.Element => {
|
const SidebarNavigationLink = React.forwardRef((props: ISidebarNavigationLink, ref: React.ForwardedRef<HTMLAnchorElement>): JSX.Element => {
|
||||||
const { icon, text, to = '', count, onClick } = props;
|
const { icon, text, to = '', count, onClick } = props;
|
||||||
const isActive = location.pathname === to;
|
const isActive = location.pathname === to;
|
||||||
|
|
Loading…
Reference in New Issue