@axos-web-dev/shared-components 2.0.0-dev.17-nav-1 → 2.0.0-dev.17-nav-3

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.
@@ -1,7 +1,25 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import "../../IconBillboard/IconBillboard.css.js";
4
+ import "../../icons/ArrowIcon/ArrowIcon.css.js";
5
+ import "../../icons/CheckIcon/CheckIcon.css.js";
6
+ /* empty css */
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ /* empty css */
11
+ /* empty css */
12
+ import { forwardRef } from "react";
2
13
  import clsx from "clsx";
14
+ /* empty css */
15
+ /* empty css */
16
+ import "../../Chevron/Chevron.css.js";
17
+ import "../../Interstitial/Interstitial-variants.css.js";
18
+ import "../../Button/Button.css.js";
19
+ import "react-use";
20
+ /* empty css */
21
+ import { useGlobalContext } from "../../Modal/contextApi/store.js";
3
22
  import Link from "next/link.js";
4
- import { forwardRef } from "react";
5
23
  import styles from "./NavBar.module.js";
6
24
  import { dd_media } from "./SubNavbar.css.js";
7
25
  const Menu = forwardRef(
@@ -17,6 +35,7 @@ const Menu = forwardRef(
17
35
  onDownKeyContainer: handleKeyDownContainer,
18
36
  onMouseLeave: handleMouseLeave
19
37
  }, containerRef) => {
38
+ const { resolveUrl } = useGlobalContext();
20
39
  const renderNavItems = Array.isArray(subNavItems) ? subNavItems.map((item) => /* @__PURE__ */ jsx(SubNavItem, { ...item }, item.id)) : [];
21
40
  return /* @__PURE__ */ jsx(
22
41
  "div",
@@ -50,7 +69,7 @@ const Menu = forwardRef(
50
69
  (cta, index) => /* @__PURE__ */ jsx(
51
70
  Link,
52
71
  {
53
- href: cta.url ?? "",
72
+ href: resolveUrl(cta.url) ?? "",
54
73
  "aria-label": cta.ariaLabel,
55
74
  className: clsx(
56
75
  "text_center",
@@ -85,7 +104,7 @@ const Menu = forwardRef(
85
104
  /* @__PURE__ */ jsx("div", { className: `${styles.headline_cta} ${styles.ml_8}`, children: /* @__PURE__ */ jsx(
86
105
  Link,
87
106
  {
88
- href: helpUrl ?? "{AXOSBANK}/partners/wholesale-correspondent-portfolio-lending/support",
107
+ href: helpUrl ? resolveUrl(helpUrl) : "{AXOSBANK}/partners/wholesale-correspondent-portfolio-lending/support",
89
108
  children: "Help & Support"
90
109
  }
91
110
  ) })
@@ -102,13 +121,14 @@ const Menu = forwardRef(
102
121
  }
103
122
  );
104
123
  const SubNavItem = ({ icon, label, url, items }) => {
124
+ const { resolveUrl } = useGlobalContext();
105
125
  const renderItems = items?.map((item) => {
106
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: item.url, children: item.label }) }, item.id);
126
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: resolveUrl(item.url), children: item.label }) }, item.id);
107
127
  });
108
128
  return /* @__PURE__ */ jsxs("div", { className: "flex_row", children: [
109
129
  /* @__PURE__ */ jsx("img", { src: icon, alt: "", width: 20, height: 20 }),
110
130
  /* @__PURE__ */ jsxs("ul", { className: `${styles.ml_8} list_unstyled`, children: [
111
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: url ?? "", role: "heading", children: label }) }),
131
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: resolveUrl(url) ?? "", role: "heading", children: label }) }),
112
132
  renderItems
113
133
  ] })
114
134
  ] });
@@ -16,7 +16,7 @@ import "clsx";
16
16
  import "../../Chevron/Chevron.css.js";
17
17
  import "../../Interstitial/Interstitial-variants.css.js";
18
18
  import "../../Button/Button.css.js";
19
- import { useLocation, useMount, useClickAway } from "react-use";
19
+ import { useLocation, useClickAway } from "react-use";
20
20
  /* empty css */
21
21
  import { useGlobalContext } from "../../Modal/contextApi/store.js";
22
22
  import { NavItem } from "../NavItem/index.js";
@@ -37,10 +37,6 @@ function NavBar({
37
37
  const toggle = () => setisOpenSignIn(!isOpenSignIn);
38
38
  const handleClick = (index) => setActiveIndex(index);
39
39
  const [isClient, setIsClient] = useState(false);
40
- const [isMounted, setIsMounted] = useState(false);
41
- useMount(() => {
42
- setIsMounted(true);
43
- });
44
40
  useEffect(() => {
45
41
  const getActiveIndex = () => {
46
42
  const index = items?.subNavBar?.findIndex((path) => {
@@ -115,7 +111,7 @@ function NavBar({
115
111
  if (pathname == "/") return item.url === "/personal";
116
112
  return item.url === pathname;
117
113
  });
118
- return /* @__PURE__ */ jsx("header", { id: "header", children: isMounted && /* @__PURE__ */ jsxs(Fragment, { children: [
114
+ return /* @__PURE__ */ jsx("header", { id: "header", children: /* @__PURE__ */ jsxs(Fragment, { children: [
119
115
  /* @__PURE__ */ jsx("div", { className: `${styles.header} bg_white`, children: /* @__PURE__ */ jsxs("div", { className: styles.wrapper, children: [
120
116
  /* @__PURE__ */ jsx(
121
117
  "a",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axos-web-dev/shared-components",
3
3
  "description": "Axos shared components library for web.",
4
- "version": "2.0.0-dev.17-nav-1",
4
+ "version": "2.0.0-dev.17-nav-3",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "module": "dist/main.js",