@danikokonn/yarik-frontend-lib 2.0.49-test5 → 2.0.49-test7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Navigation/Navigation.d.ts +1 -1
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +4 -3
- package/dist/components/Navigation/NavigationProps.d.ts +2 -0
- package/dist/components/Navigation/NavigationProps.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import NavigationProps from "./NavigationProps";
|
|
3
|
-
export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, }: NavigationProps): React.JSX.Element;
|
|
3
|
+
export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, activeTab, withReactRouter, }: NavigationProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=Navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AA4BzC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,
|
|
1
|
+
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AA4BzC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,eAAe,GAChB,EAAE,eAAe,qBAyVjB"}
|
|
@@ -22,7 +22,7 @@ import ListItemText from "@mui/material/ListItemText";
|
|
|
22
22
|
import { Button, useColorScheme, useMediaQuery } from "@mui/material";
|
|
23
23
|
import { popoverClasses } from "@mui/material/Popover";
|
|
24
24
|
import NavMenu from "./NavMenu";
|
|
25
|
-
export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, }) {
|
|
25
|
+
export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, activeTab, withReactRouter, }) {
|
|
26
26
|
const locationRouter = useLocation();
|
|
27
27
|
const { mode, setMode } = useColorScheme();
|
|
28
28
|
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
@@ -41,10 +41,11 @@ export default function Navigation({ additionalControls, username, title, navLin
|
|
|
41
41
|
const getPages = (sx, anchorOrigin, transformOrigin, endIcon) => {
|
|
42
42
|
return navLinks.map((lnk, idx) => {
|
|
43
43
|
if ("groupName" in lnk) {
|
|
44
|
-
return (React.createElement(NavMenu, { key: idx, name: lnk.groupName, routes: lnk.links, activeTab: locationRouter.pathname, sx: sx, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, endIcon: endIcon }));
|
|
44
|
+
return (React.createElement(NavMenu, { key: idx, name: lnk.groupName, routes: lnk.links, activeTab: withReactRouter ? locationRouter.pathname : activeTab || "", sx: sx, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, endIcon: endIcon }));
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
return (React.createElement(Button, { component:
|
|
47
|
+
return (React.createElement(Button, { component: withReactRouter ? RouterLink : "button", disabled: lnk.url ===
|
|
48
|
+
(withReactRouter ? locationRouter.pathname : activeTab), to: withReactRouter ? lnk.url : undefined, href: withReactRouter ? undefined : lnk.url, key: idx, sx: sx, color: "inherit", variant: "text" }, lnk.name));
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationProps.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/NavigationProps.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,KAAK,
|
|
1
|
+
{"version":3,"file":"NavigationProps.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/NavigationProps.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,KAAK,EACD,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EACD,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,aAAa,GACb,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;IACV,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CACN;QACE,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,IAAI,EAAE,CAAC;KACf,GACD,IAAI,CACP,EAAE,CAAC;CACL"}
|