mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 21:06:04 +00:00
fix active sidebar active item, added error boundaries for relational form fields, fixed schema diagram for m:n relations
This commit is contained in:
@@ -42,9 +42,16 @@ const useLocationFromRouter = (router) => {
|
||||
];
|
||||
};
|
||||
|
||||
export function isLinkActive(href: string, strict?: boolean) {
|
||||
export function isLinkActive(href: string, strictness?: number) {
|
||||
const path = window.location.pathname;
|
||||
return strict ? path === href : path.includes(href);
|
||||
|
||||
if (!strictness || strictness === 0) {
|
||||
return path.includes(href);
|
||||
} else if (strictness === 1) {
|
||||
return path === href || path.endsWith(href) || path.includes(href + "/");
|
||||
}
|
||||
|
||||
return path === href;
|
||||
}
|
||||
|
||||
export function Link({
|
||||
|
||||
Reference in New Issue
Block a user