baaz-custom-components 3.2.14 → 3.2.15

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/index.js CHANGED
@@ -82,10 +82,10 @@ function useIsMobile() {
82
82
  }
83
83
 
84
84
  // src/components/custom/navbar/navbar.tsx
85
- var import_react3 = require("react");
85
+ var import_react4 = require("react");
86
86
 
87
87
  // src/components/custom/navbar/desktopNavbar.tsx
88
- var import_react2 = require("react");
88
+ var import_react3 = require("react");
89
89
 
90
90
  // src/components/ui/dropdown-menu.tsx
91
91
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
@@ -924,18 +924,22 @@ var Notifications = ({
924
924
  var notifications_default = Notifications;
925
925
 
926
926
  // src/components/custom/navbar/sub-nav.tsx
927
+ var import_react2 = require("react");
927
928
  var import_jsx_runtime11 = require("react/jsx-runtime");
928
929
  function SubNav({
929
930
  base,
930
931
  childrenRoutes,
931
932
  router
932
933
  }) {
933
- const pathname = typeof window !== "undefined" ? window.location.pathname : "";
934
+ const [path, setPath] = (0, import_react2.useState)(router.pathname);
935
+ (0, import_react2.useEffect)(() => {
936
+ setPath(router.pathname);
937
+ }, [router.pathname]);
934
938
  if (!childrenRoutes || childrenRoutes.length === 0) return null;
935
939
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "bg-transparent border rounded-md px-2 py-1 shadow-lg flex gap-2", children: childrenRoutes.map((child) => {
936
940
  if (typeof child.routes !== "string") return null;
937
941
  const href = buildFullHref(base, child.routes);
938
- const active = isRouteActive(href, pathname);
942
+ const active = isRouteActive(href, path);
939
943
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
940
944
  "button",
941
945
  {
@@ -965,7 +969,7 @@ function DesktopNavbar({
965
969
  hubIdChangeHandler
966
970
  }) {
967
971
  const pathname = router.pathname;
968
- const activeEntry = (0, import_react2.useMemo)(() => {
972
+ const activeEntry = (0, import_react3.useMemo)(() => {
969
973
  return navbarData == null ? void 0 : navbarData.find(
970
974
  (entry) => treeContainsPath({
971
975
  data: entry.routes,
@@ -974,7 +978,7 @@ function DesktopNavbar({
974
978
  })
975
979
  );
976
980
  }, [navbarData, pathname]);
977
- const subNavData = (0, import_react2.useMemo)(() => {
981
+ const subNavData = (0, import_react3.useMemo)(() => {
978
982
  if (!activeEntry) return null;
979
983
  return getActiveRouteSiblings(
980
984
  activeEntry.routes,
@@ -1787,8 +1791,8 @@ function Navbar({
1787
1791
  notificationHandler
1788
1792
  }) {
1789
1793
  const isMobile = useIsMobile();
1790
- const [mounted, setMounted] = (0, import_react3.useState)(false);
1791
- (0, import_react3.useEffect)(() => {
1794
+ const [mounted, setMounted] = (0, import_react4.useState)(false);
1795
+ (0, import_react4.useEffect)(() => {
1792
1796
  setMounted(true);
1793
1797
  }, []);
1794
1798
  if (!mounted) return null;
package/dist/index.mjs CHANGED
@@ -48,7 +48,7 @@ function useIsMobile() {
48
48
  }
49
49
 
50
50
  // src/components/custom/navbar/navbar.tsx
51
- import { useEffect as useEffect3, useState as useState4 } from "react";
51
+ import { useEffect as useEffect4, useState as useState5 } from "react";
52
52
 
53
53
  // src/components/custom/navbar/desktopNavbar.tsx
54
54
  import { useMemo } from "react";
@@ -890,18 +890,22 @@ var Notifications = ({
890
890
  var notifications_default = Notifications;
891
891
 
892
892
  // src/components/custom/navbar/sub-nav.tsx
893
+ import { useEffect as useEffect2, useState as useState3 } from "react";
893
894
  import { jsx as jsx11 } from "react/jsx-runtime";
894
895
  function SubNav({
895
896
  base,
896
897
  childrenRoutes,
897
898
  router
898
899
  }) {
899
- const pathname = typeof window !== "undefined" ? window.location.pathname : "";
900
+ const [path, setPath] = useState3(router.pathname);
901
+ useEffect2(() => {
902
+ setPath(router.pathname);
903
+ }, [router.pathname]);
900
904
  if (!childrenRoutes || childrenRoutes.length === 0) return null;
901
905
  return /* @__PURE__ */ jsx11("div", { className: "bg-transparent border rounded-md px-2 py-1 shadow-lg flex gap-2", children: childrenRoutes.map((child) => {
902
906
  if (typeof child.routes !== "string") return null;
903
907
  const href = buildFullHref(base, child.routes);
904
- const active = isRouteActive(href, pathname);
908
+ const active = isRouteActive(href, path);
905
909
  return /* @__PURE__ */ jsx11(
906
910
  "button",
907
911
  {
@@ -1753,8 +1757,8 @@ function Navbar({
1753
1757
  notificationHandler
1754
1758
  }) {
1755
1759
  const isMobile = useIsMobile();
1756
- const [mounted, setMounted] = useState4(false);
1757
- useEffect3(() => {
1760
+ const [mounted, setMounted] = useState5(false);
1761
+ useEffect4(() => {
1758
1762
  setMounted(true);
1759
1763
  }, []);
1760
1764
  if (!mounted) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baaz-custom-components",
3
- "version": "3.2.14",
3
+ "version": "3.2.15",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",