@lendi/navbar 7.14.6 → 7.14.8

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/README.md CHANGED
@@ -52,3 +52,6 @@ export const MultiNavbar = () => {
52
52
 
53
53
  This component need to know environmentContext to describe apiBaseUrl so that it could make some API call specific to Lendi use case
54
54
  like getting broker information and get chat channel information.
55
+
56
+ This package passes the returnURL on clicking Sign-in button so that sign-in flow knows where to come back after authentication.
57
+ The usage of @lendi/navbar on homepage will set dashboard url as returnURL on clicking the sign-in button(SUB-2409)
@@ -615,9 +615,18 @@ var DesktopActionsWrapper = styled__default["default"].div.withConfig({
615
615
  componentId: "lui__sc-jh42qz-0"
616
616
  })(["display:flex;", ";"], breakpoint.between('mobile', 'desktop')(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n display: none;\n "]))));
617
617
 
618
+ var DEFAULT_DASHBOARD_URL = '/v2/dashboard/';
618
619
  var getSignInURL = (brand, env, returnURL) => {
619
620
  var urls = lalaUtils.getURLs(brand, lalaReact.Type.Customer, env);
620
- return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(returnURL !== null && returnURL !== void 0 ? returnURL : urls.origin));
621
+ var dashboardReturnURL = brand === lalaReact.Brand.Domain ? "/loanfinder".concat(DEFAULT_DASHBOARD_URL) : DEFAULT_DASHBOARD_URL;
622
+ /**
623
+ * The return URL should be based on origin
624
+ * If origin is homepage or not given, then return URL should be dashboard
625
+ * else, whatever is given.
626
+ */
627
+
628
+ var newReturnURL = returnURL === undefined || returnURL === '' || returnURL === urls.origin ? dashboardReturnURL : returnURL;
629
+ return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(newReturnURL));
621
630
  };
622
631
 
623
632
  var getEnvFromHostname = hostname => {
@@ -2121,7 +2130,7 @@ var _excluded$7 = ["children", "isOpen", "onClick"],
2121
2130
  var StyledNavButton = styled__default["default"].button.withConfig({
2122
2131
  displayName: "NavButtons__StyledNavButton",
2123
2132
  componentId: "lui__sc-1rf7mpw-0"
2124
- })(["", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";-webkit-font-smoothing:antialiased;-moz-font-smoothing:'grayscale';font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:space-between;&:hover{color:", ";}", " ", ""], buttonReset, _ref => {
2133
+ })(["", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:space-between;&:hover{color:", ";}", " ", ""], buttonReset, _ref => {
2125
2134
  var {
2126
2135
  theme
2127
2136
  } = _ref;
@@ -367,9 +367,9 @@ var _templateObject$a, _templateObject$9, RestrictionContext = React__default.de
367
367
  }, DesktopActionsWrapper = styled__default.default.div.withConfig({
368
368
  displayName: "style__DesktopActionsWrapper",
369
369
  componentId: "lui__sc-jh42qz-0"
370
- })([ "display:flex;", ";" ], breakpoint.between("mobile", "desktop")(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral([ "\n display: none;\n " ])))), getSignInURL = (brand, env, returnURL) => {
371
- var urls = lalaUtils.getURLs(brand, lalaReact.Type.Customer, env);
372
- return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(null != returnURL ? returnURL : urls.origin));
370
+ })([ "display:flex;", ";" ], breakpoint.between("mobile", "desktop")(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral([ "\n display: none;\n " ])))), DEFAULT_DASHBOARD_URL = "/v2/dashboard/", getSignInURL = (brand, env, returnURL) => {
371
+ var urls = lalaUtils.getURLs(brand, lalaReact.Type.Customer, env), dashboardReturnURL = brand === lalaReact.Brand.Domain ? "/loanfinder".concat(DEFAULT_DASHBOARD_URL) : DEFAULT_DASHBOARD_URL, newReturnURL = void 0 === returnURL || "" === returnURL || returnURL === urls.origin ? dashboardReturnURL : returnURL;
372
+ return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(newReturnURL));
373
373
  }, getEnvFromHostname = hostname => null != hostname && hostname.includes("dev.") ? lalaReact.Environment.Development : null != hostname && hostname.includes("stg.") || null != hostname && hostname.includes("stage.") ? lalaReact.Environment.Staging : null != hostname && hostname.includes("preprod.") ? lalaReact.Environment.Preproduction : null != hostname && hostname.includes("lendi.com.au") || null != hostname && hostname.includes("domain.com.au") || null != hostname && hostname.includes("aussie.com.au") ? lalaReact.Environment.Production : lalaReact.Environment.Development, RenderChatOrSideBar = _ref => {
374
374
  var {openCommPanel: openCommPanel = (() => {}), teamMember: teamMember, dashboardVariant: dashboardVariant, hasUnreadMessages: hasUnreadMessages} = _ref, primaryLabel = null != teamMember && teamMember.firstName ? "Talk to ".concat(teamMember.firstName) : LABEL_TALK_TO_EXPERT;
375
375
  return jsxRuntime.jsx(TalkExpertAction, {
@@ -1365,7 +1365,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
1365
1365
  })([ "", ";" ], utils$1.srOnly), _excluded$7 = [ "children", "isOpen", "onClick" ], _excluded2$1 = [ "children", "href", "onClick", "isActive" ], StyledNavButton = styled__default.default.button.withConfig({
1366
1366
  displayName: "NavButtons__StyledNavButton",
1367
1367
  componentId: "lui__sc-1rf7mpw-0"
1368
- })([ "", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";-webkit-font-smoothing:antialiased;-moz-font-smoothing:'grayscale';font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:space-between;&:hover{color:", ";}", " ", "" ], buttonReset, (_ref => {
1368
+ })([ "", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:space-between;&:hover{color:", ";}", " ", "" ], buttonReset, (_ref => {
1369
1369
  var {theme: theme} = _ref;
1370
1370
  return theme.color.text.inverse;
1371
1371
  }), (_ref2 => {
@@ -588,9 +588,18 @@ var DesktopActionsWrapper = styled.div.withConfig({
588
588
  componentId: "lui__sc-jh42qz-0"
589
589
  })(["display:flex;", ";"], between('mobile', 'desktop')(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n display: none;\n "]))));
590
590
 
591
+ var DEFAULT_DASHBOARD_URL = '/v2/dashboard/';
591
592
  var getSignInURL = (brand, env, returnURL) => {
592
593
  var urls = getURLs(brand, Type.Customer, env);
593
- return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(returnURL !== null && returnURL !== void 0 ? returnURL : urls.origin));
594
+ var dashboardReturnURL = brand === Brand.Domain ? "/loanfinder".concat(DEFAULT_DASHBOARD_URL) : DEFAULT_DASHBOARD_URL;
595
+ /**
596
+ * The return URL should be based on origin
597
+ * If origin is homepage or not given, then return URL should be dashboard
598
+ * else, whatever is given.
599
+ */
600
+
601
+ var newReturnURL = returnURL === undefined || returnURL === '' || returnURL === urls.origin ? dashboardReturnURL : returnURL;
602
+ return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(newReturnURL));
594
603
  };
595
604
 
596
605
  var getEnvFromHostname = hostname => {
@@ -2094,7 +2103,7 @@ var _excluded$7 = ["children", "isOpen", "onClick"],
2094
2103
  var StyledNavButton = styled.button.withConfig({
2095
2104
  displayName: "NavButtons__StyledNavButton",
2096
2105
  componentId: "lui__sc-1rf7mpw-0"
2097
- })(["", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";-webkit-font-smoothing:antialiased;-moz-font-smoothing:'grayscale';font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:space-between;&:hover{color:", ";}", " ", ""], buttonReset, _ref => {
2106
+ })(["", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:space-between;&:hover{color:", ";}", " ", ""], buttonReset, _ref => {
2098
2107
  var {
2099
2108
  theme
2100
2109
  } = _ref;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lendi/navbar",
3
3
  "access": "restricted",
4
- "version": "7.14.6",
4
+ "version": "7.14.8",
5
5
  "license": "ISC",
6
6
  "source": "src/index.tsx",
7
7
  "main": "dist/navbar.cjs.js",