@lendi/navbar 7.37.2 → 7.38.1
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/declarations/src/Header/aussie/AccountMenu.d.ts +2 -2
- package/dist/declarations/src/Header/aussie/CtaNav.d.ts +1 -1
- package/dist/declarations/src/Header/aussie/TalkToExpert.d.ts +3 -1
- package/dist/declarations/src/Header/util/index.d.ts +1 -0
- package/dist/declarations/src/shared/CommPanelProvider/index.d.ts +1 -0
- package/dist/navbar.cjs.dev.js +36 -33
- package/dist/navbar.cjs.prod.js +26 -27
- package/dist/navbar.esm.js +36 -33
- package/package.json +2 -2
|
@@ -8,6 +8,6 @@ interface SignOutProps {
|
|
|
8
8
|
onLogout: () => void;
|
|
9
9
|
}
|
|
10
10
|
export type AccountProps = AuthenticationProps & PrimaryCTAProps & TalkToExpertProps & SignOutProps;
|
|
11
|
-
export declare const AccountDropdown: ({ application, session, handleApplyNowClick,
|
|
12
|
-
export declare const AccountSlideoutMenu: ({ session, application,
|
|
11
|
+
export declare const AccountDropdown: ({ application, session, handleApplyNowClick, talkTo, openCommPanel, onLogout, }: AccountProps) => JSX.Element;
|
|
12
|
+
export declare const AccountSlideoutMenu: ({ session, application, talkTo, handleApplyNowClick, openCommPanel, onLogout, }: AccountProps) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AccountProps } from './AccountMenu';
|
|
2
|
-
export declare const CtaNav: ({ handleApplyNowClick, session, application,
|
|
2
|
+
export declare const CtaNav: ({ handleApplyNowClick, session, application, talkTo, openCommPanel, onLogout, }: AccountProps) => JSX.Element;
|
|
@@ -2,5 +2,7 @@ import { CustomerChatState } from '@lendi/chat';
|
|
|
2
2
|
export interface TalkToExpertProps {
|
|
3
3
|
openCommPanel: () => void;
|
|
4
4
|
customerOwner?: CustomerChatState['customerOwner'];
|
|
5
|
+
storeName?: CustomerChatState['storeName'];
|
|
6
|
+
talkTo?: string;
|
|
5
7
|
}
|
|
6
|
-
export declare const TalkToExpertButton: ({ openCommPanel,
|
|
8
|
+
export declare const TalkToExpertButton: ({ openCommPanel, talkTo }: TalkToExpertProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const trimStringWithEllipsis: (str: string) => string;
|
|
@@ -9,6 +9,7 @@ export interface ChatProps {
|
|
|
9
9
|
openCommPanel: () => void;
|
|
10
10
|
topOffset?: BreakpointValue<string> | BreakpointValueMap<string>;
|
|
11
11
|
customerOwner?: CustomerChatState['customerOwner'];
|
|
12
|
+
storeName?: CustomerChatState['storeName'];
|
|
12
13
|
}
|
|
13
14
|
export interface CommPanelWrapperProps extends SlideoutMenuProps {
|
|
14
15
|
toTheTop?: boolean;
|
package/dist/navbar.cjs.dev.js
CHANGED
|
@@ -1724,7 +1724,8 @@ props => {
|
|
|
1724
1724
|
closeCommPanel,
|
|
1725
1725
|
channelId,
|
|
1726
1726
|
customerOwner,
|
|
1727
|
-
openChat
|
|
1727
|
+
openChat,
|
|
1728
|
+
storeName
|
|
1728
1729
|
} = chat.useBootstrappedChatState();
|
|
1729
1730
|
var [hasUnread, setHasUnread] = React__default["default"].useState(false);
|
|
1730
1731
|
var [isOtherUserOnline, setIsOtherUserOnline] = React__default["default"].useState(false);
|
|
@@ -1751,7 +1752,8 @@ props => {
|
|
|
1751
1752
|
hasUnread: hasUnread,
|
|
1752
1753
|
closeCommPanel: closeCommPanel,
|
|
1753
1754
|
openCommPanel: openCommPanel,
|
|
1754
|
-
customerOwner: customerOwner
|
|
1755
|
+
customerOwner: customerOwner,
|
|
1756
|
+
storeName: storeName
|
|
1755
1757
|
})), /*#__PURE__*/jsxRuntime.jsx(CommPanelWrapper, _objectSpread2(_objectSpread2({
|
|
1756
1758
|
isOpen: isCommPanelOpen,
|
|
1757
1759
|
handleClose: closeCommPanel,
|
|
@@ -3416,18 +3418,14 @@ var SlideoutMenu = _ref6 => {
|
|
|
3416
3418
|
var TalkToExpertButton = _ref => {
|
|
3417
3419
|
var {
|
|
3418
3420
|
openCommPanel,
|
|
3419
|
-
|
|
3421
|
+
talkTo
|
|
3420
3422
|
} = _ref;
|
|
3421
|
-
var {
|
|
3422
|
-
cmsNavbarBrokerNameButton
|
|
3423
|
-
} = launchdarkly.useFlags();
|
|
3424
|
-
var buttonText = customerOwner !== null && customerOwner !== void 0 && customerOwner.firstName && cmsNavbarBrokerNameButton ? "Talk to ".concat(customerOwner.firstName) : 'Talk to a broker';
|
|
3425
3423
|
var handleClick = () => {
|
|
3426
3424
|
openCommPanel();
|
|
3427
3425
|
var event = {
|
|
3428
3426
|
event_name: 'Button Clicked',
|
|
3429
3427
|
category: analytics$1.EventCategory.NAVBAR,
|
|
3430
|
-
text:
|
|
3428
|
+
text: talkTo || 'Talk to a broker',
|
|
3431
3429
|
position: analytics$1.EventCategory.CMS,
|
|
3432
3430
|
customerType: analytics$1.CustomerType.CUSTOMER,
|
|
3433
3431
|
buttonType: analytics$1.ButtonType.SECONDARY
|
|
@@ -3441,7 +3439,7 @@ var TalkToExpertButton = _ref => {
|
|
|
3441
3439
|
width: "100%",
|
|
3442
3440
|
onPress: handleClick,
|
|
3443
3441
|
minWidth: utils$1.pxToRem(152),
|
|
3444
|
-
children:
|
|
3442
|
+
children: talkTo
|
|
3445
3443
|
});
|
|
3446
3444
|
};
|
|
3447
3445
|
|
|
@@ -3511,7 +3509,7 @@ var _templateObject;
|
|
|
3511
3509
|
var HamburgerCtaBlock = _ref => {
|
|
3512
3510
|
var {
|
|
3513
3511
|
handleApplyNowClick,
|
|
3514
|
-
|
|
3512
|
+
talkTo,
|
|
3515
3513
|
application,
|
|
3516
3514
|
openCommPanel
|
|
3517
3515
|
} = _ref;
|
|
@@ -3522,8 +3520,8 @@ var HamburgerCtaBlock = _ref => {
|
|
|
3522
3520
|
handleApplyNowClick: handleApplyNowClick,
|
|
3523
3521
|
application: application
|
|
3524
3522
|
}), /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
3525
|
-
|
|
3526
|
-
|
|
3523
|
+
openCommPanel: openCommPanel,
|
|
3524
|
+
talkTo: talkTo
|
|
3527
3525
|
})]
|
|
3528
3526
|
})
|
|
3529
3527
|
});
|
|
@@ -3619,7 +3617,7 @@ var LoggedInContent = _ref2 => {
|
|
|
3619
3617
|
var {
|
|
3620
3618
|
handleApplyNowClick,
|
|
3621
3619
|
application,
|
|
3622
|
-
|
|
3620
|
+
talkTo,
|
|
3623
3621
|
openCommPanel,
|
|
3624
3622
|
onLogout
|
|
3625
3623
|
} = _ref2;
|
|
@@ -3641,7 +3639,7 @@ var LoggedInContent = _ref2 => {
|
|
|
3641
3639
|
})
|
|
3642
3640
|
}), /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
3643
3641
|
openCommPanel: openCommPanel,
|
|
3644
|
-
|
|
3642
|
+
talkTo: talkTo
|
|
3645
3643
|
})]
|
|
3646
3644
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3647
3645
|
style: {
|
|
@@ -3781,8 +3779,7 @@ var AccountDropdown = _ref3 => {
|
|
|
3781
3779
|
application,
|
|
3782
3780
|
session,
|
|
3783
3781
|
handleApplyNowClick,
|
|
3784
|
-
|
|
3785
|
-
customerOwner,
|
|
3782
|
+
talkTo,
|
|
3786
3783
|
openCommPanel,
|
|
3787
3784
|
onLogout
|
|
3788
3785
|
} = _ref3;
|
|
@@ -3802,8 +3799,7 @@ var AccountDropdown = _ref3 => {
|
|
|
3802
3799
|
analytics(event);
|
|
3803
3800
|
},
|
|
3804
3801
|
children: isAuthenticated ? /*#__PURE__*/jsxRuntime.jsx(LoggedInContent, {
|
|
3805
|
-
|
|
3806
|
-
customerOwner: customerOwner,
|
|
3802
|
+
talkTo: talkTo,
|
|
3807
3803
|
application: application,
|
|
3808
3804
|
handleApplyNowClick: handleApplyNowClick,
|
|
3809
3805
|
openCommPanel: openCommPanel,
|
|
@@ -3815,8 +3811,7 @@ var AccountSlideoutMenu = _ref4 => {
|
|
|
3815
3811
|
var {
|
|
3816
3812
|
session,
|
|
3817
3813
|
application,
|
|
3818
|
-
|
|
3819
|
-
customerOwner,
|
|
3814
|
+
talkTo,
|
|
3820
3815
|
handleApplyNowClick,
|
|
3821
3816
|
openCommPanel,
|
|
3822
3817
|
onLogout
|
|
@@ -3861,8 +3856,7 @@ var AccountSlideoutMenu = _ref4 => {
|
|
|
3861
3856
|
title: loggedInOutText,
|
|
3862
3857
|
hasTitleDivider: false,
|
|
3863
3858
|
children: isAuthenticated ? /*#__PURE__*/jsxRuntime.jsx(LoggedInContent, {
|
|
3864
|
-
|
|
3865
|
-
customerOwner: customerOwner,
|
|
3859
|
+
talkTo: talkTo,
|
|
3866
3860
|
application: application,
|
|
3867
3861
|
handleApplyNowClick: handleApplyNowClick,
|
|
3868
3862
|
openCommPanel: openCommPanel,
|
|
@@ -3877,8 +3871,7 @@ var CtaNav = _ref => {
|
|
|
3877
3871
|
handleApplyNowClick,
|
|
3878
3872
|
session,
|
|
3879
3873
|
application,
|
|
3880
|
-
|
|
3881
|
-
teamMember,
|
|
3874
|
+
talkTo,
|
|
3882
3875
|
openCommPanel,
|
|
3883
3876
|
onLogout
|
|
3884
3877
|
} = _ref;
|
|
@@ -3887,7 +3880,7 @@ var CtaNav = _ref => {
|
|
|
3887
3880
|
children: [/*#__PURE__*/jsxRuntime.jsx(ShowFromTweakLarge, {
|
|
3888
3881
|
children: /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
3889
3882
|
openCommPanel: openCommPanel,
|
|
3890
|
-
|
|
3883
|
+
talkTo: talkTo
|
|
3891
3884
|
})
|
|
3892
3885
|
}), /*#__PURE__*/jsxRuntime.jsx(ShowFromSmall, {
|
|
3893
3886
|
children: /*#__PURE__*/jsxRuntime.jsx(PrimaryCTA, {
|
|
@@ -3898,8 +3891,7 @@ var CtaNav = _ref => {
|
|
|
3898
3891
|
children: /*#__PURE__*/jsxRuntime.jsx(AccountDropdown, {
|
|
3899
3892
|
handleApplyNowClick: handleApplyNowClick,
|
|
3900
3893
|
session: session,
|
|
3901
|
-
|
|
3902
|
-
customerOwner: customerOwner,
|
|
3894
|
+
talkTo: talkTo,
|
|
3903
3895
|
application: application,
|
|
3904
3896
|
openCommPanel: openCommPanel,
|
|
3905
3897
|
onLogout: onLogout
|
|
@@ -3908,8 +3900,7 @@ var CtaNav = _ref => {
|
|
|
3908
3900
|
children: /*#__PURE__*/jsxRuntime.jsx(AccountSlideoutMenu, {
|
|
3909
3901
|
handleApplyNowClick: handleApplyNowClick,
|
|
3910
3902
|
session: session,
|
|
3911
|
-
|
|
3912
|
-
customerOwner: customerOwner,
|
|
3903
|
+
talkTo: talkTo,
|
|
3913
3904
|
application: application,
|
|
3914
3905
|
openCommPanel: openCommPanel,
|
|
3915
3906
|
onLogout: onLogout
|
|
@@ -3994,6 +3985,14 @@ var useApplication = session => {
|
|
|
3994
3985
|
return application;
|
|
3995
3986
|
};
|
|
3996
3987
|
|
|
3988
|
+
var trimStringWithEllipsis = str => {
|
|
3989
|
+
if (str.length > 17) {
|
|
3990
|
+
return str.substring(0, 14) + '...';
|
|
3991
|
+
} else {
|
|
3992
|
+
return str;
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3995
|
+
|
|
3997
3996
|
var HeaderWithContext = _ref => {
|
|
3998
3997
|
var {
|
|
3999
3998
|
// Public props
|
|
@@ -4004,13 +4003,17 @@ var HeaderWithContext = _ref => {
|
|
|
4004
4003
|
isCommPanelOpen,
|
|
4005
4004
|
closeCommPanel,
|
|
4006
4005
|
openCommPanel: _openCommPanel,
|
|
4007
|
-
customerOwner
|
|
4006
|
+
customerOwner,
|
|
4007
|
+
storeName
|
|
4008
4008
|
} = _ref;
|
|
4009
4009
|
var session = lalaReact.useSession();
|
|
4010
4010
|
var application = useApplication(session);
|
|
4011
|
-
|
|
4011
|
+
var {
|
|
4012
|
+
cmsNavbarBrokerNameButton
|
|
4013
|
+
} = launchdarkly.useFlags();
|
|
4012
4014
|
//to set AHL value in session storage for funnel1 journey
|
|
4013
4015
|
useAHLParam();
|
|
4016
|
+
var textForTalkTo = cmsNavbarBrokerNameButton ? "Talk to ".concat(trimStringWithEllipsis((customerOwner === null || customerOwner === void 0 ? void 0 : customerOwner.firstName) || storeName || 'broker')) : 'Talk to a broker';
|
|
4014
4017
|
return /*#__PURE__*/jsxRuntime.jsx(HeaderBase, {
|
|
4015
4018
|
navSlot: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4016
4019
|
children: [/*#__PURE__*/jsxRuntime.jsx(ShowFromTweakLarge, {
|
|
@@ -4021,7 +4024,7 @@ var HeaderWithContext = _ref => {
|
|
|
4021
4024
|
children: /*#__PURE__*/jsxRuntime.jsx(HamburgerMenu, {
|
|
4022
4025
|
handleApplyNowClick: handleApplyNow,
|
|
4023
4026
|
application: application,
|
|
4024
|
-
|
|
4027
|
+
talkTo: textForTalkTo,
|
|
4025
4028
|
navOptions: navOptions,
|
|
4026
4029
|
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel()
|
|
4027
4030
|
})
|
|
@@ -4031,7 +4034,7 @@ var HeaderWithContext = _ref => {
|
|
|
4031
4034
|
handleApplyNowClick: handleApplyNow,
|
|
4032
4035
|
application: application,
|
|
4033
4036
|
session: session,
|
|
4034
|
-
|
|
4037
|
+
talkTo: textForTalkTo,
|
|
4035
4038
|
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel(),
|
|
4036
4039
|
onLogout: onLogout
|
|
4037
4040
|
})
|
package/dist/navbar.cjs.prod.js
CHANGED
|
@@ -1078,7 +1078,7 @@ var _templateObject$9, _templateObject2$4, _templateObject$8, _templateObject2$3
|
|
|
1078
1078
|
var {toTheTop: toTheTop} = _ref2;
|
|
1079
1079
|
return toTheTop && styled.css([ "top:0;z-index:999;" ]);
|
|
1080
1080
|
})), withCommPanelWrapper = Component => props => {
|
|
1081
|
-
var {onException: onException} = useError(), {chatBubble: chatBubble, chatExperiment: chatExperiment} = launchdarkly.useFlags(), {isCommPanelOpen: isCommPanelOpen, openCommPanel: openCommPanel, closeCommPanel: closeCommPanel, channelId: channelId, customerOwner: customerOwner, openChat: openChat} = chat.useBootstrappedChatState(), [hasUnread, setHasUnread] = React__default.default.useState(!1), [isOtherUserOnline, setIsOtherUserOnline] = React__default.default.useState(!1), [breakpoint$1, setBreakpoint] = React__default.default.useState(), [renderChatBubble, setRenderChatBubble] = React.useState(!1);
|
|
1081
|
+
var {onException: onException} = useError(), {chatBubble: chatBubble, chatExperiment: chatExperiment} = launchdarkly.useFlags(), {isCommPanelOpen: isCommPanelOpen, openCommPanel: openCommPanel, closeCommPanel: closeCommPanel, channelId: channelId, customerOwner: customerOwner, openChat: openChat, storeName: storeName} = chat.useBootstrappedChatState(), [hasUnread, setHasUnread] = React__default.default.useState(!1), [isOtherUserOnline, setIsOtherUserOnline] = React__default.default.useState(!1), [breakpoint$1, setBreakpoint] = React__default.default.useState(), [renderChatBubble, setRenderChatBubble] = React.useState(!1);
|
|
1082
1082
|
breakpoint.useBreakpoint(setBreakpoint);
|
|
1083
1083
|
var shouldFullScreen = "aussie" === utils$1.getThemeName() || "mobile" === breakpoint$1, isExperiment = "Experiment1" === chatExperiment || "Experiment3" === chatExperiment;
|
|
1084
1084
|
return React.useEffect((() => (props.enableChatBubble && chatBubble && isExperiment && setRenderChatBubble(!0),
|
|
@@ -1092,7 +1092,8 @@ var _templateObject$9, _templateObject2$4, _templateObject$8, _templateObject2$3
|
|
|
1092
1092
|
hasUnread: hasUnread,
|
|
1093
1093
|
closeCommPanel: closeCommPanel,
|
|
1094
1094
|
openCommPanel: openCommPanel,
|
|
1095
|
-
customerOwner: customerOwner
|
|
1095
|
+
customerOwner: customerOwner,
|
|
1096
|
+
storeName: storeName
|
|
1096
1097
|
})), jsxRuntime.jsx(CommPanelWrapper, _objectSpread2(_objectSpread2({
|
|
1097
1098
|
isOpen: isCommPanelOpen,
|
|
1098
1099
|
handleClose: closeCommPanel,
|
|
@@ -2242,7 +2243,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2242
2243
|
}) ]
|
|
2243
2244
|
}));
|
|
2244
2245
|
}, TalkToExpertButton = _ref => {
|
|
2245
|
-
var {openCommPanel: openCommPanel,
|
|
2246
|
+
var {openCommPanel: openCommPanel, talkTo: talkTo} = _ref;
|
|
2246
2247
|
return jsxRuntime.jsx(Button.Button, {
|
|
2247
2248
|
variant: "secondary",
|
|
2248
2249
|
"data-component": "navbar-button-talk-to-expert",
|
|
@@ -2253,7 +2254,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2253
2254
|
var event = {
|
|
2254
2255
|
event_name: "Button Clicked",
|
|
2255
2256
|
category: analytics$1.EventCategory.NAVBAR,
|
|
2256
|
-
text:
|
|
2257
|
+
text: talkTo || "Talk to a broker",
|
|
2257
2258
|
position: analytics$1.EventCategory.CMS,
|
|
2258
2259
|
customerType: analytics$1.CustomerType.CUSTOMER,
|
|
2259
2260
|
buttonType: analytics$1.ButtonType.SECONDARY
|
|
@@ -2261,7 +2262,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2261
2262
|
analytics(event);
|
|
2262
2263
|
},
|
|
2263
2264
|
minWidth: utils$1.pxToRem(152),
|
|
2264
|
-
children:
|
|
2265
|
+
children: talkTo
|
|
2265
2266
|
});
|
|
2266
2267
|
}, APPLY_HREF = "/home-loans/basics", ApplyNowButton = _ref => {
|
|
2267
2268
|
var _URLSearchParams, {onClick: onClick, width: width, size: size} = _ref, params = (null === (_URLSearchParams = new URLSearchParams(window.location.search)) || void 0 === _URLSearchParams ? void 0 : _URLSearchParams.toString()) || void 0, newApplyHref = params ? "".concat(APPLY_HREF, "/?").concat(params) : APPLY_HREF;
|
|
@@ -2309,7 +2310,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2309
2310
|
width: "100%"
|
|
2310
2311
|
});
|
|
2311
2312
|
}, _excluded = [ "navOptions" ], HamburgerCtaBlock = _ref => {
|
|
2312
|
-
var {handleApplyNowClick: handleApplyNowClick,
|
|
2313
|
+
var {handleApplyNowClick: handleApplyNowClick, talkTo: talkTo, application: application, openCommPanel: openCommPanel} = _ref;
|
|
2313
2314
|
return jsxRuntime.jsx(MenuPadding, {
|
|
2314
2315
|
children: jsxRuntime.jsxs(Layout.Spacer, {
|
|
2315
2316
|
ygap: "12",
|
|
@@ -2317,8 +2318,8 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2317
2318
|
handleApplyNowClick: handleApplyNowClick,
|
|
2318
2319
|
application: application
|
|
2319
2320
|
}), jsxRuntime.jsx(TalkToExpertButton, {
|
|
2320
|
-
|
|
2321
|
-
|
|
2321
|
+
openCommPanel: openCommPanel,
|
|
2322
|
+
talkTo: talkTo
|
|
2322
2323
|
}) ]
|
|
2323
2324
|
})
|
|
2324
2325
|
});
|
|
@@ -2389,7 +2390,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2389
2390
|
children: "Manage your loan applications"
|
|
2390
2391
|
}), jsxRuntime.jsx(StyledHR, {}) ]
|
|
2391
2392
|
}), LoggedInContent = _ref2 => {
|
|
2392
|
-
var {handleApplyNowClick: handleApplyNowClick, application: application,
|
|
2393
|
+
var {handleApplyNowClick: handleApplyNowClick, application: application, talkTo: talkTo, openCommPanel: openCommPanel, onLogout: onLogout} = _ref2, {referAFriend: referAFriend} = launchdarkly.useFlags();
|
|
2393
2394
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2394
2395
|
children: [ jsxRuntime.jsxs(DropdownPrimaryContent, {
|
|
2395
2396
|
style: {
|
|
@@ -2405,7 +2406,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2405
2406
|
})
|
|
2406
2407
|
}), jsxRuntime.jsx(TalkToExpertButton, {
|
|
2407
2408
|
openCommPanel: openCommPanel,
|
|
2408
|
-
|
|
2409
|
+
talkTo: talkTo
|
|
2409
2410
|
}) ]
|
|
2410
2411
|
}), jsxRuntime.jsxs("div", {
|
|
2411
2412
|
style: {
|
|
@@ -2530,7 +2531,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2530
2531
|
}) ]
|
|
2531
2532
|
});
|
|
2532
2533
|
}, AccountDropdown = _ref3 => {
|
|
2533
|
-
var {application: application, session: session, handleApplyNowClick: handleApplyNowClick,
|
|
2534
|
+
var {application: application, session: session, handleApplyNowClick: handleApplyNowClick, talkTo: talkTo, openCommPanel: openCommPanel, onLogout: onLogout} = _ref3, isAuthenticated = (null == session ? void 0 : session.status) === lalaReact.Status.Authenticated;
|
|
2534
2535
|
return jsxRuntime.jsx(NavDropdown, {
|
|
2535
2536
|
label: isAuthenticated ? LOGGEDIN_TEXT : LOGGEDOUT_TEXT,
|
|
2536
2537
|
align: "right",
|
|
@@ -2546,8 +2547,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2546
2547
|
analytics(event);
|
|
2547
2548
|
},
|
|
2548
2549
|
children: isAuthenticated ? jsxRuntime.jsx(LoggedInContent, {
|
|
2549
|
-
|
|
2550
|
-
customerOwner: customerOwner,
|
|
2550
|
+
talkTo: talkTo,
|
|
2551
2551
|
application: application,
|
|
2552
2552
|
handleApplyNowClick: handleApplyNowClick,
|
|
2553
2553
|
openCommPanel: openCommPanel,
|
|
@@ -2555,7 +2555,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2555
2555
|
}) : jsxRuntime.jsx(LoggedOutContent, {})
|
|
2556
2556
|
});
|
|
2557
2557
|
}, AccountSlideoutMenu = _ref4 => {
|
|
2558
|
-
var {session: session, application: application,
|
|
2558
|
+
var {session: session, application: application, talkTo: talkTo, handleApplyNowClick: handleApplyNowClick, openCommPanel: openCommPanel, onLogout: onLogout} = _ref4, {showMenu: showMenu, toggleMenu: toggleMenu} = useSlideoutMenu(), isAuthenticated = (null == session ? void 0 : session.status) === lalaReact.Status.Authenticated, loggedInOutText = isAuthenticated ? LOGGEDIN_TEXT : LOGGEDOUT_TEXT, handleClick = () => {
|
|
2559
2559
|
toggleMenu();
|
|
2560
2560
|
var event = {
|
|
2561
2561
|
event_name: "Menu Clicked",
|
|
@@ -2589,8 +2589,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2589
2589
|
title: loggedInOutText,
|
|
2590
2590
|
hasTitleDivider: !1,
|
|
2591
2591
|
children: isAuthenticated ? jsxRuntime.jsx(LoggedInContent, {
|
|
2592
|
-
|
|
2593
|
-
customerOwner: customerOwner,
|
|
2592
|
+
talkTo: talkTo,
|
|
2594
2593
|
application: application,
|
|
2595
2594
|
handleApplyNowClick: handleApplyNowClick,
|
|
2596
2595
|
openCommPanel: openCommPanel,
|
|
@@ -2599,13 +2598,13 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2599
2598
|
}) ]
|
|
2600
2599
|
});
|
|
2601
2600
|
}, CtaNav = _ref => {
|
|
2602
|
-
var {handleApplyNowClick: handleApplyNowClick, session: session, application: application,
|
|
2601
|
+
var {handleApplyNowClick: handleApplyNowClick, session: session, application: application, talkTo: talkTo, openCommPanel: openCommPanel, onLogout: onLogout} = _ref;
|
|
2603
2602
|
return jsxRuntime.jsxs(Layout.Spacer, {
|
|
2604
2603
|
xalign: "center",
|
|
2605
2604
|
children: [ jsxRuntime.jsx(ShowFromTweakLarge, {
|
|
2606
2605
|
children: jsxRuntime.jsx(TalkToExpertButton, {
|
|
2607
2606
|
openCommPanel: openCommPanel,
|
|
2608
|
-
|
|
2607
|
+
talkTo: talkTo
|
|
2609
2608
|
})
|
|
2610
2609
|
}), jsxRuntime.jsx(ShowFromSmall, {
|
|
2611
2610
|
children: jsxRuntime.jsx(PrimaryCTA, {
|
|
@@ -2616,8 +2615,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2616
2615
|
children: jsxRuntime.jsx(AccountDropdown, {
|
|
2617
2616
|
handleApplyNowClick: handleApplyNowClick,
|
|
2618
2617
|
session: session,
|
|
2619
|
-
|
|
2620
|
-
customerOwner: customerOwner,
|
|
2618
|
+
talkTo: talkTo,
|
|
2621
2619
|
application: application,
|
|
2622
2620
|
openCommPanel: openCommPanel,
|
|
2623
2621
|
onLogout: onLogout
|
|
@@ -2626,8 +2624,7 @@ var _templateObject$3, _templateObject2$1, _templateObject$2, _templateObject$1,
|
|
|
2626
2624
|
children: jsxRuntime.jsx(AccountSlideoutMenu, {
|
|
2627
2625
|
handleApplyNowClick: handleApplyNowClick,
|
|
2628
2626
|
session: session,
|
|
2629
|
-
|
|
2630
|
-
customerOwner: customerOwner,
|
|
2627
|
+
talkTo: talkTo,
|
|
2631
2628
|
application: application,
|
|
2632
2629
|
openCommPanel: openCommPanel,
|
|
2633
2630
|
onLogout: onLogout
|
|
@@ -2692,9 +2689,11 @@ var getApplications = function() {
|
|
|
2692
2689
|
onException(new Error("@lendi/navbar: unable to fetch application: ".concat(error)));
|
|
2693
2690
|
})) : setApplication(void 0);
|
|
2694
2691
|
}), [ session, onException ]), application;
|
|
2695
|
-
}, HeaderWithContext = _ref => {
|
|
2696
|
-
var {handleApplyNow: handleApplyNow, onLogout: onLogout, navOptions: navOptions = [], isCommPanelOpen: isCommPanelOpen, closeCommPanel: closeCommPanel, openCommPanel: _openCommPanel, customerOwner: customerOwner} = _ref, session = lalaReact.useSession(), application = useApplication(session);
|
|
2697
|
-
|
|
2692
|
+
}, trimStringWithEllipsis = str => str.length > 17 ? str.substring(0, 14) + "..." : str, HeaderWithContext = _ref => {
|
|
2693
|
+
var {handleApplyNow: handleApplyNow, onLogout: onLogout, navOptions: navOptions = [], isCommPanelOpen: isCommPanelOpen, closeCommPanel: closeCommPanel, openCommPanel: _openCommPanel, customerOwner: customerOwner, storeName: storeName} = _ref, session = lalaReact.useSession(), application = useApplication(session), {cmsNavbarBrokerNameButton: cmsNavbarBrokerNameButton} = launchdarkly.useFlags();
|
|
2694
|
+
useAHLParam();
|
|
2695
|
+
var textForTalkTo = cmsNavbarBrokerNameButton ? "Talk to ".concat(trimStringWithEllipsis((null == customerOwner ? void 0 : customerOwner.firstName) || storeName || "broker")) : "Talk to a broker";
|
|
2696
|
+
return jsxRuntime.jsx(HeaderBase, {
|
|
2698
2697
|
navSlot: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2699
2698
|
children: [ jsxRuntime.jsx(ShowFromTweakLarge, {
|
|
2700
2699
|
children: jsxRuntime.jsx(Nav, {
|
|
@@ -2704,7 +2703,7 @@ var getApplications = function() {
|
|
|
2704
2703
|
children: jsxRuntime.jsx(HamburgerMenu, {
|
|
2705
2704
|
handleApplyNowClick: handleApplyNow,
|
|
2706
2705
|
application: application,
|
|
2707
|
-
|
|
2706
|
+
talkTo: textForTalkTo,
|
|
2708
2707
|
navOptions: navOptions,
|
|
2709
2708
|
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel()
|
|
2710
2709
|
})
|
|
@@ -2714,7 +2713,7 @@ var getApplications = function() {
|
|
|
2714
2713
|
handleApplyNowClick: handleApplyNow,
|
|
2715
2714
|
application: application,
|
|
2716
2715
|
session: session,
|
|
2717
|
-
|
|
2716
|
+
talkTo: textForTalkTo,
|
|
2718
2717
|
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel(),
|
|
2719
2718
|
onLogout: onLogout
|
|
2720
2719
|
})
|
package/dist/navbar.esm.js
CHANGED
|
@@ -1691,7 +1691,8 @@ props => {
|
|
|
1691
1691
|
closeCommPanel,
|
|
1692
1692
|
channelId,
|
|
1693
1693
|
customerOwner,
|
|
1694
|
-
openChat
|
|
1694
|
+
openChat,
|
|
1695
|
+
storeName
|
|
1695
1696
|
} = useBootstrappedChatState();
|
|
1696
1697
|
var [hasUnread, setHasUnread] = React.useState(false);
|
|
1697
1698
|
var [isOtherUserOnline, setIsOtherUserOnline] = React.useState(false);
|
|
@@ -1718,7 +1719,8 @@ props => {
|
|
|
1718
1719
|
hasUnread: hasUnread,
|
|
1719
1720
|
closeCommPanel: closeCommPanel,
|
|
1720
1721
|
openCommPanel: openCommPanel,
|
|
1721
|
-
customerOwner: customerOwner
|
|
1722
|
+
customerOwner: customerOwner,
|
|
1723
|
+
storeName: storeName
|
|
1722
1724
|
})), /*#__PURE__*/jsx(CommPanelWrapper, _objectSpread2(_objectSpread2({
|
|
1723
1725
|
isOpen: isCommPanelOpen,
|
|
1724
1726
|
handleClose: closeCommPanel,
|
|
@@ -3383,18 +3385,14 @@ var SlideoutMenu = _ref6 => {
|
|
|
3383
3385
|
var TalkToExpertButton = _ref => {
|
|
3384
3386
|
var {
|
|
3385
3387
|
openCommPanel,
|
|
3386
|
-
|
|
3388
|
+
talkTo
|
|
3387
3389
|
} = _ref;
|
|
3388
|
-
var {
|
|
3389
|
-
cmsNavbarBrokerNameButton
|
|
3390
|
-
} = useFlags();
|
|
3391
|
-
var buttonText = customerOwner !== null && customerOwner !== void 0 && customerOwner.firstName && cmsNavbarBrokerNameButton ? "Talk to ".concat(customerOwner.firstName) : 'Talk to a broker';
|
|
3392
3390
|
var handleClick = () => {
|
|
3393
3391
|
openCommPanel();
|
|
3394
3392
|
var event = {
|
|
3395
3393
|
event_name: 'Button Clicked',
|
|
3396
3394
|
category: EventCategory.NAVBAR,
|
|
3397
|
-
text:
|
|
3395
|
+
text: talkTo || 'Talk to a broker',
|
|
3398
3396
|
position: EventCategory.CMS,
|
|
3399
3397
|
customerType: CustomerType.CUSTOMER,
|
|
3400
3398
|
buttonType: ButtonType.SECONDARY
|
|
@@ -3408,7 +3406,7 @@ var TalkToExpertButton = _ref => {
|
|
|
3408
3406
|
width: "100%",
|
|
3409
3407
|
onPress: handleClick,
|
|
3410
3408
|
minWidth: pxToRem(152),
|
|
3411
|
-
children:
|
|
3409
|
+
children: talkTo
|
|
3412
3410
|
});
|
|
3413
3411
|
};
|
|
3414
3412
|
|
|
@@ -3478,7 +3476,7 @@ var _templateObject;
|
|
|
3478
3476
|
var HamburgerCtaBlock = _ref => {
|
|
3479
3477
|
var {
|
|
3480
3478
|
handleApplyNowClick,
|
|
3481
|
-
|
|
3479
|
+
talkTo,
|
|
3482
3480
|
application,
|
|
3483
3481
|
openCommPanel
|
|
3484
3482
|
} = _ref;
|
|
@@ -3489,8 +3487,8 @@ var HamburgerCtaBlock = _ref => {
|
|
|
3489
3487
|
handleApplyNowClick: handleApplyNowClick,
|
|
3490
3488
|
application: application
|
|
3491
3489
|
}), /*#__PURE__*/jsx(TalkToExpertButton, {
|
|
3492
|
-
|
|
3493
|
-
|
|
3490
|
+
openCommPanel: openCommPanel,
|
|
3491
|
+
talkTo: talkTo
|
|
3494
3492
|
})]
|
|
3495
3493
|
})
|
|
3496
3494
|
});
|
|
@@ -3586,7 +3584,7 @@ var LoggedInContent = _ref2 => {
|
|
|
3586
3584
|
var {
|
|
3587
3585
|
handleApplyNowClick,
|
|
3588
3586
|
application,
|
|
3589
|
-
|
|
3587
|
+
talkTo,
|
|
3590
3588
|
openCommPanel,
|
|
3591
3589
|
onLogout
|
|
3592
3590
|
} = _ref2;
|
|
@@ -3608,7 +3606,7 @@ var LoggedInContent = _ref2 => {
|
|
|
3608
3606
|
})
|
|
3609
3607
|
}), /*#__PURE__*/jsx(TalkToExpertButton, {
|
|
3610
3608
|
openCommPanel: openCommPanel,
|
|
3611
|
-
|
|
3609
|
+
talkTo: talkTo
|
|
3612
3610
|
})]
|
|
3613
3611
|
}), /*#__PURE__*/jsxs("div", {
|
|
3614
3612
|
style: {
|
|
@@ -3748,8 +3746,7 @@ var AccountDropdown = _ref3 => {
|
|
|
3748
3746
|
application,
|
|
3749
3747
|
session,
|
|
3750
3748
|
handleApplyNowClick,
|
|
3751
|
-
|
|
3752
|
-
customerOwner,
|
|
3749
|
+
talkTo,
|
|
3753
3750
|
openCommPanel,
|
|
3754
3751
|
onLogout
|
|
3755
3752
|
} = _ref3;
|
|
@@ -3769,8 +3766,7 @@ var AccountDropdown = _ref3 => {
|
|
|
3769
3766
|
analytics(event);
|
|
3770
3767
|
},
|
|
3771
3768
|
children: isAuthenticated ? /*#__PURE__*/jsx(LoggedInContent, {
|
|
3772
|
-
|
|
3773
|
-
customerOwner: customerOwner,
|
|
3769
|
+
talkTo: talkTo,
|
|
3774
3770
|
application: application,
|
|
3775
3771
|
handleApplyNowClick: handleApplyNowClick,
|
|
3776
3772
|
openCommPanel: openCommPanel,
|
|
@@ -3782,8 +3778,7 @@ var AccountSlideoutMenu = _ref4 => {
|
|
|
3782
3778
|
var {
|
|
3783
3779
|
session,
|
|
3784
3780
|
application,
|
|
3785
|
-
|
|
3786
|
-
customerOwner,
|
|
3781
|
+
talkTo,
|
|
3787
3782
|
handleApplyNowClick,
|
|
3788
3783
|
openCommPanel,
|
|
3789
3784
|
onLogout
|
|
@@ -3828,8 +3823,7 @@ var AccountSlideoutMenu = _ref4 => {
|
|
|
3828
3823
|
title: loggedInOutText,
|
|
3829
3824
|
hasTitleDivider: false,
|
|
3830
3825
|
children: isAuthenticated ? /*#__PURE__*/jsx(LoggedInContent, {
|
|
3831
|
-
|
|
3832
|
-
customerOwner: customerOwner,
|
|
3826
|
+
talkTo: talkTo,
|
|
3833
3827
|
application: application,
|
|
3834
3828
|
handleApplyNowClick: handleApplyNowClick,
|
|
3835
3829
|
openCommPanel: openCommPanel,
|
|
@@ -3844,8 +3838,7 @@ var CtaNav = _ref => {
|
|
|
3844
3838
|
handleApplyNowClick,
|
|
3845
3839
|
session,
|
|
3846
3840
|
application,
|
|
3847
|
-
|
|
3848
|
-
teamMember,
|
|
3841
|
+
talkTo,
|
|
3849
3842
|
openCommPanel,
|
|
3850
3843
|
onLogout
|
|
3851
3844
|
} = _ref;
|
|
@@ -3854,7 +3847,7 @@ var CtaNav = _ref => {
|
|
|
3854
3847
|
children: [/*#__PURE__*/jsx(ShowFromTweakLarge, {
|
|
3855
3848
|
children: /*#__PURE__*/jsx(TalkToExpertButton, {
|
|
3856
3849
|
openCommPanel: openCommPanel,
|
|
3857
|
-
|
|
3850
|
+
talkTo: talkTo
|
|
3858
3851
|
})
|
|
3859
3852
|
}), /*#__PURE__*/jsx(ShowFromSmall, {
|
|
3860
3853
|
children: /*#__PURE__*/jsx(PrimaryCTA, {
|
|
@@ -3865,8 +3858,7 @@ var CtaNav = _ref => {
|
|
|
3865
3858
|
children: /*#__PURE__*/jsx(AccountDropdown, {
|
|
3866
3859
|
handleApplyNowClick: handleApplyNowClick,
|
|
3867
3860
|
session: session,
|
|
3868
|
-
|
|
3869
|
-
customerOwner: customerOwner,
|
|
3861
|
+
talkTo: talkTo,
|
|
3870
3862
|
application: application,
|
|
3871
3863
|
openCommPanel: openCommPanel,
|
|
3872
3864
|
onLogout: onLogout
|
|
@@ -3875,8 +3867,7 @@ var CtaNav = _ref => {
|
|
|
3875
3867
|
children: /*#__PURE__*/jsx(AccountSlideoutMenu, {
|
|
3876
3868
|
handleApplyNowClick: handleApplyNowClick,
|
|
3877
3869
|
session: session,
|
|
3878
|
-
|
|
3879
|
-
customerOwner: customerOwner,
|
|
3870
|
+
talkTo: talkTo,
|
|
3880
3871
|
application: application,
|
|
3881
3872
|
openCommPanel: openCommPanel,
|
|
3882
3873
|
onLogout: onLogout
|
|
@@ -3961,6 +3952,14 @@ var useApplication = session => {
|
|
|
3961
3952
|
return application;
|
|
3962
3953
|
};
|
|
3963
3954
|
|
|
3955
|
+
var trimStringWithEllipsis = str => {
|
|
3956
|
+
if (str.length > 17) {
|
|
3957
|
+
return str.substring(0, 14) + '...';
|
|
3958
|
+
} else {
|
|
3959
|
+
return str;
|
|
3960
|
+
}
|
|
3961
|
+
};
|
|
3962
|
+
|
|
3964
3963
|
var HeaderWithContext = _ref => {
|
|
3965
3964
|
var {
|
|
3966
3965
|
// Public props
|
|
@@ -3971,13 +3970,17 @@ var HeaderWithContext = _ref => {
|
|
|
3971
3970
|
isCommPanelOpen,
|
|
3972
3971
|
closeCommPanel,
|
|
3973
3972
|
openCommPanel: _openCommPanel,
|
|
3974
|
-
customerOwner
|
|
3973
|
+
customerOwner,
|
|
3974
|
+
storeName
|
|
3975
3975
|
} = _ref;
|
|
3976
3976
|
var session = useSession();
|
|
3977
3977
|
var application = useApplication(session);
|
|
3978
|
-
|
|
3978
|
+
var {
|
|
3979
|
+
cmsNavbarBrokerNameButton
|
|
3980
|
+
} = useFlags();
|
|
3979
3981
|
//to set AHL value in session storage for funnel1 journey
|
|
3980
3982
|
useAHLParam();
|
|
3983
|
+
var textForTalkTo = cmsNavbarBrokerNameButton ? "Talk to ".concat(trimStringWithEllipsis((customerOwner === null || customerOwner === void 0 ? void 0 : customerOwner.firstName) || storeName || 'broker')) : 'Talk to a broker';
|
|
3981
3984
|
return /*#__PURE__*/jsx(HeaderBase, {
|
|
3982
3985
|
navSlot: /*#__PURE__*/jsxs(Fragment, {
|
|
3983
3986
|
children: [/*#__PURE__*/jsx(ShowFromTweakLarge, {
|
|
@@ -3988,7 +3991,7 @@ var HeaderWithContext = _ref => {
|
|
|
3988
3991
|
children: /*#__PURE__*/jsx(HamburgerMenu, {
|
|
3989
3992
|
handleApplyNowClick: handleApplyNow,
|
|
3990
3993
|
application: application,
|
|
3991
|
-
|
|
3994
|
+
talkTo: textForTalkTo,
|
|
3992
3995
|
navOptions: navOptions,
|
|
3993
3996
|
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel()
|
|
3994
3997
|
})
|
|
@@ -3998,7 +4001,7 @@ var HeaderWithContext = _ref => {
|
|
|
3998
4001
|
handleApplyNowClick: handleApplyNow,
|
|
3999
4002
|
application: application,
|
|
4000
4003
|
session: session,
|
|
4001
|
-
|
|
4004
|
+
talkTo: textForTalkTo,
|
|
4002
4005
|
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel(),
|
|
4003
4006
|
onLogout: onLogout
|
|
4004
4007
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lendi/navbar",
|
|
3
3
|
"access": "restricted",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.38.1",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"source": "src/index.tsx",
|
|
7
7
|
"main": "dist/navbar.cjs.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@lendi-ui/typography": "^5.13.11-beta.0",
|
|
41
41
|
"@lendi-ui/utils": "^6.0.2-beta.1",
|
|
42
42
|
"@lendi/analytics": "^4.6.0",
|
|
43
|
-
"@lendi/chat": "^1.
|
|
43
|
+
"@lendi/chat": "^1.18.0",
|
|
44
44
|
"@lendi/lala-utils": "^11.8.0",
|
|
45
45
|
"@lendi/launchdarkly": "^0.1.7",
|
|
46
46
|
"@lendi/lendigroup-leads-library": "^3.2.1",
|