cleanup package.json, update sass, fix router (css class issue)
This commit is contained in:
@@ -5,12 +5,12 @@ import {useRouter} from "./RouterContext";
|
||||
import {Path} from "./router";
|
||||
|
||||
export function Link(props: {className?: string, href: Path, replace?: boolean } & PropsWithChildren) {
|
||||
const {children, className, href, replace} = props;
|
||||
const {children, className, href} = props;
|
||||
const router = useRouter();
|
||||
|
||||
function onClick(event: React.MouseEvent) {
|
||||
// event.preventDefault();
|
||||
if(replace) {
|
||||
event.preventDefault();
|
||||
if(window.location.pathname === href) {
|
||||
router.replacePage(props.href);
|
||||
} else {
|
||||
router.pushPage(props.href);
|
||||
|
||||
Reference in New Issue
Block a user