modified router link
This commit is contained in:
parent
d21ed03508
commit
b82eb8290b
@ -1 +1,18 @@
|
|||||||
export { NavLink as RouterLink } from "react-router-dom";
|
import classNames from "classnames";
|
||||||
|
import { NavLink, NavLinkProps, To } from "react-router-dom";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
enabled?: boolean;
|
||||||
|
children?: React.ReactNode;
|
||||||
|
} & NavLinkProps;
|
||||||
|
|
||||||
|
export function RouterLink({ children, enabled = true, className, to }: Props) {
|
||||||
|
return (
|
||||||
|
<NavLink
|
||||||
|
to={to}
|
||||||
|
className={classNames({ "pointer-events-none": !enabled }, className)}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</NavLink>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user