@lendi/navbar 7.31.1 → 7.32.0

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.
@@ -1137,6 +1137,9 @@ var PanelLinks = _ref => {
1137
1137
  store,
1138
1138
  broker
1139
1139
  } = _ref;
1140
+ var {
1141
+ enhancedPrl
1142
+ } = launchdarkly.useFlags();
1140
1143
  var {
1141
1144
  name
1142
1145
  } = Theme.useTheme();
@@ -1181,11 +1184,15 @@ var PanelLinks = _ref => {
1181
1184
  onClick: () => {
1182
1185
  // Set Leads if customer clicked on BookApointment from Store page.
1183
1186
  // Unset Leads (to undefined) if customer clicked on BookApointment from non-Store page.
1184
- store !== null && store !== void 0 && store.id ? lendigroupLeadsLibrary.LendiGroupLeads.setStoreId(store === null || store === void 0 ? void 0 : store.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetStoreId();
1185
1187
  // Set and Unset Leads if customer clicked on BookApointment from Broker page.
1186
1188
  // Unset Leads (to undefined) if customer clicked on BookApointment from non-Broker page.
1187
- // @ts-ignore As of coding, @lendi/lendigroup-leads-library does NOT support setting leads to undefined. ts-ignoring it.
1188
- broker !== null && broker !== void 0 && broker.id ? lendigroupLeadsLibrary.LendiGroupLeads.setBrokerId(broker === null || broker === void 0 ? void 0 : broker.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetBrokerId();
1189
+ if (!enhancedPrl) {
1190
+ store !== null && store !== void 0 && store.id ? lendigroupLeadsLibrary.LendiGroupLeads.setStoreId(store === null || store === void 0 ? void 0 : store.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetStoreId();
1191
+ broker !== null && broker !== void 0 && broker.id ? lendigroupLeadsLibrary.LendiGroupLeads.setBrokerId(broker === null || broker === void 0 ? void 0 : broker.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetBrokerId();
1192
+ } else {
1193
+ store !== null && store !== void 0 && store.id ? sessionStorage.setItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_STORE_ID, store === null || store === void 0 ? void 0 : store.id) : sessionStorage.removeItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_STORE_ID);
1194
+ broker !== null && broker !== void 0 && broker.id ? sessionStorage.setItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_BROKER_ID, broker === null || broker === void 0 ? void 0 : broker.id) : sessionStorage.removeItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_BROKER_ID);
1195
+ }
1189
1196
  // Analytics
1190
1197
  var linkEvent = {
1191
1198
  event_name: 'Link Clicked',
@@ -712,7 +712,7 @@ var _excluded$a = [ "showTalkToExpertCta" ], withDomainChat = Component => _ref
712
712
  domain: "/loanfinder",
713
713
  aussie: ""
714
714
  }, toTel = phoneNumber => "tel:+61".concat(phoneNumber.replace(/ /g, "")), PanelLinks = _ref => {
715
- var _teamMember$phoneNumb, {teamMember: teamMember, store: store, broker: broker} = _ref, {name: name} = Theme.useTheme(), currentTheme = name;
715
+ var _teamMember$phoneNumb, {teamMember: teamMember, store: store, broker: broker} = _ref, {enhancedPrl: enhancedPrl} = launchdarkly.useFlags(), {name: name} = Theme.useTheme(), currentTheme = name;
716
716
  "lendi-next" === currentTheme && (currentTheme = "lendi");
717
717
  var path = BOOKING_PATHS[currentTheme], phoneLabel = null !== (_teamMember$phoneNumb = null == teamMember ? void 0 : teamMember.phoneNumber) && void 0 !== _teamMember$phoneNumb ? _teamMember$phoneNumb : CONTACT_NUMBERS[currentTheme], phoneLink = null != teamMember && teamMember.phoneNumber ? toTel(teamMember.phoneNumber) : "tel:".concat(phoneLabel.replace(/ /g, ""));
718
718
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -749,8 +749,9 @@ var _excluded$a = [ "showTalkToExpertCta" ], withDomainChat = Component => _ref
749
749
  "data-testid": "customer-view-appointment-link",
750
750
  "data-component": "customer-view-appointment-link",
751
751
  onClick: () => {
752
- null != store && store.id ? lendigroupLeadsLibrary.LendiGroupLeads.setStoreId(null == store ? void 0 : store.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetStoreId(),
753
- null != broker && broker.id ? lendigroupLeadsLibrary.LendiGroupLeads.setBrokerId(null == broker ? void 0 : broker.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetBrokerId();
752
+ enhancedPrl ? (null != store && store.id ? sessionStorage.setItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_STORE_ID, null == store ? void 0 : store.id) : sessionStorage.removeItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_STORE_ID),
753
+ null != broker && broker.id ? sessionStorage.setItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_BROKER_ID, null == broker ? void 0 : broker.id) : sessionStorage.removeItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_REQUESTED_BROKER_ID)) : (null != store && store.id ? lendigroupLeadsLibrary.LendiGroupLeads.setStoreId(null == store ? void 0 : store.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetStoreId(),
754
+ null != broker && broker.id ? lendigroupLeadsLibrary.LendiGroupLeads.setBrokerId(null == broker ? void 0 : broker.id) : lendigroupLeadsLibrary.LendiGroupLeads.unsetBrokerId());
754
755
  var linkEvent = {
755
756
  event_name: "Link Clicked",
756
757
  text: "Book an appointment",
@@ -11,7 +11,7 @@ import { Button, IconButton } from '@lendi-ui/button';
11
11
  import UnreadMessage from '@lendi-ui/icon/UnreadMessage';
12
12
  import { display, normalise, deriveSize } from '@lendi-ui/utils';
13
13
  import MoreVert from '@lendi-ui/icon/MoreVert';
14
- import { getBrandFromHostname, Brand, getURLs, getAPIBaseURL } from '@lendi/lala-utils';
14
+ import { getBrandFromHostname, Brand, getURLs, SESSION_STORAGE_KEYS, getAPIBaseURL } from '@lendi/lala-utils';
15
15
  import { useFlags, withLendiLDProvider } from '@lendi/launchdarkly';
16
16
  import { getRadius, getFocusRing } from '@lendi-ui/commons/borders';
17
17
  import getColour, { getColour as getColour$1 } from '@lendi-ui/commons/colours';
@@ -1104,6 +1104,9 @@ var PanelLinks = _ref => {
1104
1104
  store,
1105
1105
  broker
1106
1106
  } = _ref;
1107
+ var {
1108
+ enhancedPrl
1109
+ } = useFlags();
1107
1110
  var {
1108
1111
  name
1109
1112
  } = useTheme();
@@ -1148,11 +1151,15 @@ var PanelLinks = _ref => {
1148
1151
  onClick: () => {
1149
1152
  // Set Leads if customer clicked on BookApointment from Store page.
1150
1153
  // Unset Leads (to undefined) if customer clicked on BookApointment from non-Store page.
1151
- store !== null && store !== void 0 && store.id ? LendiGroupLeads.setStoreId(store === null || store === void 0 ? void 0 : store.id) : LendiGroupLeads.unsetStoreId();
1152
1154
  // Set and Unset Leads if customer clicked on BookApointment from Broker page.
1153
1155
  // Unset Leads (to undefined) if customer clicked on BookApointment from non-Broker page.
1154
- // @ts-ignore As of coding, @lendi/lendigroup-leads-library does NOT support setting leads to undefined. ts-ignoring it.
1155
- broker !== null && broker !== void 0 && broker.id ? LendiGroupLeads.setBrokerId(broker === null || broker === void 0 ? void 0 : broker.id) : LendiGroupLeads.unsetBrokerId();
1156
+ if (!enhancedPrl) {
1157
+ store !== null && store !== void 0 && store.id ? LendiGroupLeads.setStoreId(store === null || store === void 0 ? void 0 : store.id) : LendiGroupLeads.unsetStoreId();
1158
+ broker !== null && broker !== void 0 && broker.id ? LendiGroupLeads.setBrokerId(broker === null || broker === void 0 ? void 0 : broker.id) : LendiGroupLeads.unsetBrokerId();
1159
+ } else {
1160
+ store !== null && store !== void 0 && store.id ? sessionStorage.setItem(SESSION_STORAGE_KEYS.CTOR_REQUESTED_STORE_ID, store === null || store === void 0 ? void 0 : store.id) : sessionStorage.removeItem(SESSION_STORAGE_KEYS.CTOR_REQUESTED_STORE_ID);
1161
+ broker !== null && broker !== void 0 && broker.id ? sessionStorage.setItem(SESSION_STORAGE_KEYS.CTOR_REQUESTED_BROKER_ID, broker === null || broker === void 0 ? void 0 : broker.id) : sessionStorage.removeItem(SESSION_STORAGE_KEYS.CTOR_REQUESTED_BROKER_ID);
1162
+ }
1156
1163
  // Analytics
1157
1164
  var linkEvent = {
1158
1165
  event_name: 'Link Clicked',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lendi/navbar",
3
3
  "access": "restricted",
4
- "version": "7.31.1",
4
+ "version": "7.32.0",
5
5
  "license": "ISC",
6
6
  "source": "src/index.tsx",
7
7
  "main": "dist/navbar.cjs.js",
@@ -41,7 +41,7 @@
41
41
  "@lendi-ui/utils": "^6.0.2-beta.1",
42
42
  "@lendi/analytics": "^4.6.0",
43
43
  "@lendi/chat": "^1.13.0",
44
- "@lendi/lala-utils": "^11.2.0",
44
+ "@lendi/lala-utils": "^11.8.0",
45
45
  "@lendi/launchdarkly": "^0.1.7",
46
46
  "@lendi/lendigroup-leads-library": "^3.2.1",
47
47
  "@lendi/ui": "^0.3.0",