@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-v0.9.0.0 → 1.2.0-SNAPSHOT-header-v0.11.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.
- package/dist/BusinessDropdown/index.d.ts.map +1 -1
- package/dist/Header.d.ts.map +1 -1
- package/dist/HeaderAnimatedMask /hooks.d.ts.map +1 -1
- package/dist/LobsHeader/index.d.ts.map +1 -1
- package/dist/RewardsSection/LoyaltyChips.d.ts.map +1 -1
- package/dist/RewardsSection/index.d.ts.map +1 -1
- package/dist/UserAccount/UserAccountDropdown.d.ts.map +1 -1
- package/dist/UserAccount/accountOptions.d.ts +1 -0
- package/dist/UserAccount/accountOptions.d.ts.map +1 -1
- package/dist/UserAccount/index.d.ts.map +1 -1
- package/dist/constants.d.ts +34 -31
- package/dist/constants.d.ts.map +1 -1
- package/dist/ct-design-header.browser.cjs.js +1 -1
- package/dist/ct-design-header.browser.cjs.js.map +1 -1
- package/dist/ct-design-header.browser.esm.js +1 -1
- package/dist/ct-design-header.browser.esm.js.map +1 -1
- package/dist/ct-design-header.cjs.js +390 -148
- package/dist/ct-design-header.cjs.js.map +1 -1
- package/dist/ct-design-header.esm.js +391 -149
- package/dist/ct-design-header.esm.js.map +1 -1
- package/dist/ct-design-header.umd.js +390 -148
- package/dist/ct-design-header.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/type.d.ts +17 -1
- package/dist/type.d.ts.map +1 -1
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +7 -8
|
@@ -15,23 +15,27 @@ var SUPPORT_URL = '/support';
|
|
|
15
15
|
var NAVBAR_OPTIONS = [{
|
|
16
16
|
lefticon: ctDesignIcons.Offers,
|
|
17
17
|
text: 'Offers',
|
|
18
|
+
ravenActionName: 'offers',
|
|
18
19
|
isHoverable: false,
|
|
19
20
|
isClickable: true,
|
|
20
21
|
link: OFFERS_URL
|
|
21
22
|
}, {
|
|
22
23
|
lefticon: ctDesignIcons.BusinessBag,
|
|
23
24
|
text: 'Business',
|
|
25
|
+
ravenActionName: 'business',
|
|
24
26
|
rightIcon: ctDesignIcons.ChevronDown,
|
|
25
27
|
isHoverable: true
|
|
26
28
|
}, {
|
|
27
29
|
lefticon: ctDesignIcons.MyTrips,
|
|
28
30
|
text: 'My Trips',
|
|
31
|
+
ravenActionName: 'mytrips',
|
|
29
32
|
isHoverable: false,
|
|
30
33
|
isClickable: true,
|
|
31
34
|
link: MY_TRIPS_URL
|
|
32
35
|
}, {
|
|
33
36
|
lefticon: ctDesignIcons.SupportIcon,
|
|
34
37
|
text: 'Support',
|
|
38
|
+
ravenActionName: 'support',
|
|
35
39
|
isHoverable: false,
|
|
36
40
|
isClickable: true,
|
|
37
41
|
link: SUPPORT_URL
|
|
@@ -45,33 +49,36 @@ var LOBS = {
|
|
|
45
49
|
};
|
|
46
50
|
var LOB_DATA = [{
|
|
47
51
|
title: LOBS.FLIGHTS,
|
|
48
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
52
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true',
|
|
49
53
|
link: '/flights'
|
|
50
54
|
}, {
|
|
51
55
|
title: LOBS.HOTELS,
|
|
52
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
56
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true',
|
|
53
57
|
link: '/hotels'
|
|
54
58
|
}, {
|
|
55
59
|
title: LOBS.BUSES,
|
|
56
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
60
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true',
|
|
57
61
|
link: '/bus'
|
|
58
62
|
}, {
|
|
59
63
|
title: LOBS.TRAIN,
|
|
60
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
64
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Trains.png?cache=true',
|
|
61
65
|
link: '/pages/trains/appOnly'
|
|
62
66
|
}, {
|
|
63
67
|
title: LOBS.PACKAGES,
|
|
64
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
68
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true',
|
|
65
69
|
link: '/holidays'
|
|
66
70
|
}];
|
|
67
71
|
var bdConfig = [{
|
|
68
72
|
title: 'AgentBox',
|
|
69
73
|
subtitle: 'For travel agents',
|
|
70
|
-
details: 'One-stop travel solution offering the best deals to our travel agency partners'
|
|
74
|
+
details: 'One-stop travel solution offering the best deals to our travel agency partners',
|
|
75
|
+
link: 'https://agency.cleartrip.com'
|
|
71
76
|
}, {
|
|
72
77
|
title: 'OutOfOffice',
|
|
73
78
|
subtitle: 'For startups, corporates and SMEs',
|
|
74
|
-
details: 'Manage corporate business travel, smartly'
|
|
79
|
+
details: 'Manage corporate business travel, smartly',
|
|
80
|
+
link: 'https://ooo.cleartrip.com/',
|
|
81
|
+
ravenActionName: 'ooo'
|
|
75
82
|
}, {
|
|
76
83
|
title: 'MICE',
|
|
77
84
|
subtitle: 'For corporate events',
|
|
@@ -84,16 +91,35 @@ var bdConfig = [{
|
|
|
84
91
|
link: 'https://business.cleartrip.com/api-customers/more-details'
|
|
85
92
|
}];
|
|
86
93
|
var BUSINESS_DROPDOWN_HEADING = 'Other business services';
|
|
87
|
-
|
|
94
|
+
exports.RAVEN_PAGE_NAMES = void 0;
|
|
88
95
|
(function (RAVEN_PAGE_NAMES) {
|
|
89
96
|
RAVEN_PAGE_NAMES["UNIFIED_HOME"] = "unified_homepage";
|
|
90
|
-
RAVEN_PAGE_NAMES["HOTELS_HOME"] = "
|
|
91
|
-
RAVEN_PAGE_NAMES["FLIGHTS_HOME"] = "
|
|
92
|
-
})(RAVEN_PAGE_NAMES || (RAVEN_PAGE_NAMES = {}));
|
|
97
|
+
RAVEN_PAGE_NAMES["HOTELS_HOME"] = "hotel_home";
|
|
98
|
+
RAVEN_PAGE_NAMES["FLIGHTS_HOME"] = "flights_home";
|
|
99
|
+
})(exports.RAVEN_PAGE_NAMES || (exports.RAVEN_PAGE_NAMES = {}));
|
|
93
100
|
var RAVEN_PLATFORMS;
|
|
94
101
|
(function (RAVEN_PLATFORMS) {
|
|
95
102
|
RAVEN_PLATFORMS["DESKTOP"] = "desktop";
|
|
96
103
|
})(RAVEN_PLATFORMS || (RAVEN_PLATFORMS = {}));
|
|
104
|
+
var LOG_IN_TEXT = 'Log in';
|
|
105
|
+
var THEME_CONFIG = {
|
|
106
|
+
NOVAC: {
|
|
107
|
+
headerBackground: 'transparent',
|
|
108
|
+
hoverColor: '#FFB8A5',
|
|
109
|
+
logoFill: '#FFF',
|
|
110
|
+
fkcompanyColor: '#FFF',
|
|
111
|
+
typographyColor: '#FFF',
|
|
112
|
+
loginButtonColorVariant: ctDesignButton.ButtonColor.NEUTRAL
|
|
113
|
+
},
|
|
114
|
+
DEFAULT: {
|
|
115
|
+
headerBackground: '#F7FAFF',
|
|
116
|
+
hoverColor: '#FF4F17',
|
|
117
|
+
logoFill: '#FF4F17',
|
|
118
|
+
fkcompanyColor: '#1A1A1A',
|
|
119
|
+
typographyColor: '#1A1A1A',
|
|
120
|
+
loginButtonColorVariant: ctDesignButton.ButtonColor.PRIMARY
|
|
121
|
+
}
|
|
122
|
+
};
|
|
97
123
|
|
|
98
124
|
var HeaderContext = react.createContext(undefined);
|
|
99
125
|
var useHeaderContext = function () {
|
|
@@ -129,33 +155,33 @@ var LobsHeader = function () {
|
|
|
129
155
|
}
|
|
130
156
|
}, {
|
|
131
157
|
children: LOB_DATA.map(function (item, index) {
|
|
158
|
+
var title = item.title,
|
|
159
|
+
link = item.link,
|
|
160
|
+
image = item.image;
|
|
132
161
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
133
162
|
display: 'flex',
|
|
134
163
|
alignItems: 'center',
|
|
135
164
|
cursor: 'pointer',
|
|
136
165
|
css: {
|
|
137
166
|
gap: 8,
|
|
138
|
-
background: selectedLOB ===
|
|
139
|
-
borderRadius: selectedLOB ===
|
|
140
|
-
padding: selectedLOB ===
|
|
167
|
+
background: selectedLOB === title ? '#FFFFFF' : 'transparent',
|
|
168
|
+
borderRadius: selectedLOB === title ? '40px' : '0',
|
|
169
|
+
padding: selectedLOB === title ? '8px 16px 8px 8px' : '0'
|
|
141
170
|
},
|
|
142
171
|
onClick: function () {
|
|
143
|
-
window.location.href =
|
|
172
|
+
window.location.href = link;
|
|
144
173
|
}
|
|
145
174
|
}, {
|
|
146
175
|
children: [jsxRuntime.jsx("img", {
|
|
147
|
-
src:
|
|
148
|
-
alt:
|
|
176
|
+
src: image,
|
|
177
|
+
alt: title,
|
|
149
178
|
width: 32,
|
|
150
179
|
height: 32
|
|
151
180
|
}), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
152
|
-
variant:
|
|
153
|
-
style: {
|
|
154
|
-
fontWeight: selectedLOB === item.title ? 600 : 500
|
|
155
|
-
},
|
|
181
|
+
variant: selectedLOB === title ? ctDesignTypography.TypographyVariant.HM3 : ctDesignTypography.TypographyVariant.B1,
|
|
156
182
|
isClickable: true
|
|
157
183
|
}, {
|
|
158
|
-
children:
|
|
184
|
+
children: title
|
|
159
185
|
}))]
|
|
160
186
|
}), index);
|
|
161
187
|
})
|
|
@@ -356,11 +382,85 @@ var useDropdownAnimation = function (isOpen) {
|
|
|
356
382
|
};
|
|
357
383
|
};
|
|
358
384
|
|
|
385
|
+
var stringifyPayload = function (payload) {
|
|
386
|
+
var keys = Object.keys(payload);
|
|
387
|
+
var numericValues = [];
|
|
388
|
+
keys.forEach(function (key) {
|
|
389
|
+
if (numericValues.includes(key)) {
|
|
390
|
+
payload[key] = Number(payload[key]);
|
|
391
|
+
} else {
|
|
392
|
+
payload[key] = '' + payload[key];
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
return payload;
|
|
396
|
+
};
|
|
397
|
+
var isServer = function () {
|
|
398
|
+
return typeof window === 'undefined' || !window;
|
|
399
|
+
};
|
|
400
|
+
var getQueryParam = function (queryParam) {
|
|
401
|
+
if (isServer()) {
|
|
402
|
+
return '';
|
|
403
|
+
}
|
|
404
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
405
|
+
return urlParams.get(queryParam);
|
|
406
|
+
};
|
|
407
|
+
var ravenLoyaltyTypes = function (loyaltyType) {
|
|
408
|
+
switch (loyaltyType) {
|
|
409
|
+
case 'FkVip':
|
|
410
|
+
return 'fk_vip';
|
|
411
|
+
case 'FkPremium':
|
|
412
|
+
return 'fk_plus_premium';
|
|
413
|
+
case 'InsiderIcon':
|
|
414
|
+
return 'myntra_insidericon';
|
|
415
|
+
case 'InsiderElite':
|
|
416
|
+
return 'myntra_insiderelite';
|
|
417
|
+
default:
|
|
418
|
+
return '';
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
var ravenSDKTrigger = function (isUserLoggedIn, eventName, ravenPayload, customRavenPayload, ravenPushCallback, pageName) {
|
|
422
|
+
var _a;
|
|
423
|
+
if (typeof ravenPushCallback !== 'function') {
|
|
424
|
+
console.error('ravenPushCallback is not provided or is not a function');
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
var commonPayload = {
|
|
428
|
+
page_name: pageName,
|
|
429
|
+
platform: RAVEN_PLATFORMS.DESKTOP,
|
|
430
|
+
login_status: isUserLoggedIn ? 'yes' : 'no',
|
|
431
|
+
domain: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host
|
|
432
|
+
};
|
|
433
|
+
var newRavenPayload = stringifyPayload(ravenPayload);
|
|
434
|
+
var parsedCustomRavenPayload = stringifyPayload(customRavenPayload);
|
|
435
|
+
var finalPayload = tslib.__assign(tslib.__assign(tslib.__assign({}, commonPayload), newRavenPayload), parsedCustomRavenPayload);
|
|
436
|
+
try {
|
|
437
|
+
if (ravenPushCallback.length === 1) {
|
|
438
|
+
ravenPushCallback({
|
|
439
|
+
eventName: eventName,
|
|
440
|
+
eventData: finalPayload
|
|
441
|
+
});
|
|
442
|
+
} else {
|
|
443
|
+
ravenPushCallback(eventName, finalPayload);
|
|
444
|
+
}
|
|
445
|
+
} catch (err) {
|
|
446
|
+
console.error(err);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
|
|
359
451
|
var BusinessDropdownContent = function (_a) {
|
|
360
452
|
var isOpen = _a.isOpen;
|
|
361
|
-
var _b =
|
|
362
|
-
|
|
363
|
-
|
|
453
|
+
var _b = useHeaderContext(),
|
|
454
|
+
isUserLoggedIn = _b.isUserLoggedIn,
|
|
455
|
+
ravenPushCallback = _b.ravenPushCallback,
|
|
456
|
+
ravenPageName = _b.ravenPageName,
|
|
457
|
+
ravenEventName = _b.ravenEventName,
|
|
458
|
+
loyaltyType = _b.loyaltyType,
|
|
459
|
+
_c = _b.ravenPayload,
|
|
460
|
+
ravenPayload = _c === void 0 ? {} : _c;
|
|
461
|
+
var _d = react.useState(0),
|
|
462
|
+
leftPosition = _d[0],
|
|
463
|
+
setLeftPosition = _d[1];
|
|
364
464
|
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
365
465
|
react.useEffect(function () {
|
|
366
466
|
var updatePosition = function () {
|
|
@@ -379,6 +479,21 @@ var BusinessDropdownContent = function (_a) {
|
|
|
379
479
|
return window.removeEventListener('resize', updatePosition);
|
|
380
480
|
};
|
|
381
481
|
}, [containerRef, leftPosition]);
|
|
482
|
+
var handleBusinessDropdownClick = react.useCallback(function (link, title, ravenActionName) {
|
|
483
|
+
var _a;
|
|
484
|
+
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
485
|
+
var actionName = ravenActionName ? "".concat(ravenActionName, "_business_click") : title ? "".concat(title.toLowerCase(), "_business_click") : '';
|
|
486
|
+
var defaultPayload = {
|
|
487
|
+
action_name: actionName,
|
|
488
|
+
action_type: 'click',
|
|
489
|
+
u_utm_source: utmSource,
|
|
490
|
+
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
491
|
+
};
|
|
492
|
+
if (link) {
|
|
493
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
494
|
+
window.location.href = link;
|
|
495
|
+
}
|
|
496
|
+
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
|
|
382
497
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
383
498
|
ref: containerRef,
|
|
384
499
|
backgroundColor: '#fff',
|
|
@@ -399,10 +514,7 @@ var BusinessDropdownContent = function (_a) {
|
|
|
399
514
|
backgroundColor: '#FFF1EC'
|
|
400
515
|
}, {
|
|
401
516
|
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
402
|
-
variant: 'HM2'
|
|
403
|
-
css: {
|
|
404
|
-
lineHeight: '24px'
|
|
405
|
-
}
|
|
517
|
+
variant: 'HM2'
|
|
406
518
|
}, {
|
|
407
519
|
children: BUSINESS_DROPDOWN_HEADING
|
|
408
520
|
}))
|
|
@@ -416,11 +528,16 @@ var BusinessDropdownContent = function (_a) {
|
|
|
416
528
|
children: bdConfig.map(function (_a) {
|
|
417
529
|
var title = _a.title,
|
|
418
530
|
subtitle = _a.subtitle,
|
|
419
|
-
details = _a.details
|
|
531
|
+
details = _a.details,
|
|
532
|
+
link = _a.link,
|
|
533
|
+
ravenActionName = _a.ravenActionName;
|
|
420
534
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
421
535
|
cursor: 'pointer',
|
|
422
536
|
width: '200px',
|
|
423
|
-
className: 'bd-hover-container'
|
|
537
|
+
className: 'bd-hover-container',
|
|
538
|
+
onClick: function () {
|
|
539
|
+
return handleBusinessDropdownClick(link, title, ravenActionName);
|
|
540
|
+
}
|
|
424
541
|
}, {
|
|
425
542
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
426
543
|
display: 'flex',
|
|
@@ -519,6 +636,7 @@ var ACCOUNT_OPTIONS_POPUP_CONFIG = [{
|
|
|
519
636
|
redirectionLink: 'accounts/personal-data-dashboard'
|
|
520
637
|
}];
|
|
521
638
|
var SIGN_OUT_TEXT = 'Logout';
|
|
639
|
+
var MY_ACCOUNT_TEXT = 'My Account';
|
|
522
640
|
var LOGGEDIN_USER_TEXT = 'You are logged in with';
|
|
523
641
|
var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
|
|
524
642
|
var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
|
|
@@ -530,13 +648,33 @@ var LoyaltyChip = function (_a) {
|
|
|
530
648
|
backgroundGradient = _a.backgroundGradient,
|
|
531
649
|
handleChipClick = _a.handleChipClick,
|
|
532
650
|
chevronFillColor = _a.chevronFillColor;
|
|
533
|
-
var _b =
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
651
|
+
var _b = useHeaderContext(),
|
|
652
|
+
loyaltyType = _b.loyaltyType,
|
|
653
|
+
isUserLoggedIn = _b.isUserLoggedIn,
|
|
654
|
+
ravenPushCallback = _b.ravenPushCallback,
|
|
655
|
+
ravenPageName = _b.ravenPageName,
|
|
656
|
+
_c = _b.ravenPayload,
|
|
657
|
+
ravenPayload = _c === void 0 ? {} : _c,
|
|
658
|
+
ravenEventName = _b.ravenEventName;
|
|
659
|
+
var _d = react.useState(false),
|
|
660
|
+
isHovered = _d[0],
|
|
661
|
+
setIsHovered = _d[1];
|
|
662
|
+
var handleClick = react.useCallback(function () {
|
|
663
|
+
var _a;
|
|
664
|
+
if (handleChipClick) {
|
|
665
|
+
handleChipClick();
|
|
666
|
+
} else {
|
|
667
|
+
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
668
|
+
var defaultPayload = {
|
|
669
|
+
action_name: "loyalty_account_click",
|
|
670
|
+
action_type: 'click',
|
|
671
|
+
u_utm_source: utmSource,
|
|
672
|
+
loyaltyType: ravenLoyaltyTypes(loyaltyType)
|
|
673
|
+
};
|
|
674
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
675
|
+
window.location.href = '/all-offers/loyalty-october';
|
|
676
|
+
}
|
|
677
|
+
}, [handleChipClick, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
540
678
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
541
679
|
display: 'flex',
|
|
542
680
|
position: 'relative',
|
|
@@ -561,7 +699,7 @@ var LoyaltyChip = function (_a) {
|
|
|
561
699
|
onClick: handleClick
|
|
562
700
|
}, {
|
|
563
701
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
564
|
-
|
|
702
|
+
css: {
|
|
565
703
|
content: '""',
|
|
566
704
|
position: 'absolute',
|
|
567
705
|
inset: 0,
|
|
@@ -570,7 +708,7 @@ var LoyaltyChip = function (_a) {
|
|
|
570
708
|
zIndex: -2
|
|
571
709
|
}
|
|
572
710
|
}), jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
573
|
-
|
|
711
|
+
css: {
|
|
574
712
|
content: '""',
|
|
575
713
|
position: 'absolute',
|
|
576
714
|
inset: 0,
|
|
@@ -591,7 +729,7 @@ var LoyaltyChip = function (_a) {
|
|
|
591
729
|
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
592
730
|
display: 'flex',
|
|
593
731
|
alignItems: 'center',
|
|
594
|
-
|
|
732
|
+
css: {
|
|
595
733
|
overflow: 'hidden',
|
|
596
734
|
maxWidth: isHovered ? 16 : 0,
|
|
597
735
|
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
@@ -656,24 +794,46 @@ var ExpandableItem = function (_a) {
|
|
|
656
794
|
handleChipClick = _a.handleChipClick,
|
|
657
795
|
value = _a.value,
|
|
658
796
|
type = _a.type;
|
|
659
|
-
var _b =
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
797
|
+
var _b = useHeaderContext(),
|
|
798
|
+
loyaltyType = _b.loyaltyType,
|
|
799
|
+
isUserLoggedIn = _b.isUserLoggedIn,
|
|
800
|
+
ravenPushCallback = _b.ravenPushCallback,
|
|
801
|
+
ravenPageName = _b.ravenPageName,
|
|
802
|
+
ravenEventName = _b.ravenEventName,
|
|
803
|
+
_c = _b.ravenPayload,
|
|
804
|
+
ravenPayload = _c === void 0 ? {} : _c;
|
|
805
|
+
var _d = react.useState(false),
|
|
806
|
+
isHovered = _d[0],
|
|
807
|
+
setIsHovered = _d[1];
|
|
808
|
+
var handleDefaultClick = react.useCallback(function () {
|
|
809
|
+
var _a;
|
|
810
|
+
if (handleChipClick) {
|
|
811
|
+
handleChipClick();
|
|
812
|
+
} else {
|
|
813
|
+
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
814
|
+
var defaultPayload = {
|
|
815
|
+
action_name: "".concat(type, "_account_click"),
|
|
816
|
+
action_type: 'click',
|
|
817
|
+
u_utm_source: utmSource,
|
|
818
|
+
loyaltyType: ravenLoyaltyTypes(loyaltyType)
|
|
819
|
+
};
|
|
820
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
821
|
+
var redirectUrls = {
|
|
822
|
+
supercoin: '/all-offers/supercoins/',
|
|
823
|
+
wallet: '/accounts/wallet'
|
|
824
|
+
};
|
|
825
|
+
if (redirectUrls[type]) {
|
|
826
|
+
window.location.href = redirectUrls[type];
|
|
827
|
+
}
|
|
667
828
|
}
|
|
668
|
-
|
|
669
|
-
};
|
|
829
|
+
}, [handleChipClick, type, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
670
830
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
671
831
|
display: 'flex',
|
|
672
832
|
alignItems: 'center',
|
|
673
833
|
justifyContent: 'center',
|
|
674
834
|
borderRadius: '8px',
|
|
675
835
|
cursor: 'pointer',
|
|
676
|
-
|
|
836
|
+
css: {
|
|
677
837
|
height: 32,
|
|
678
838
|
paddingLeft: 8,
|
|
679
839
|
paddingRight: isHovered ? 4 : 8,
|
|
@@ -704,7 +864,7 @@ var ExpandableItem = function (_a) {
|
|
|
704
864
|
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
705
865
|
display: 'flex',
|
|
706
866
|
alignItems: 'center',
|
|
707
|
-
|
|
867
|
+
css: {
|
|
708
868
|
overflow: 'hidden',
|
|
709
869
|
maxWidth: isHovered ? 16 : 0,
|
|
710
870
|
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
@@ -732,6 +892,12 @@ var RewardsSection = function () {
|
|
|
732
892
|
hideWalletChip = _b.hideWalletChip,
|
|
733
893
|
hideSupercoinsChip = _b.hideSupercoinsChip,
|
|
734
894
|
hideLoyaltyChip = _b.hideLoyaltyChip;
|
|
895
|
+
var shouldShowLoyalty = loyaltyLoading || selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && !hideLoyaltyChip;
|
|
896
|
+
var shouldShowSupercoin = superCoinsLoading || !hideSupercoinsChip;
|
|
897
|
+
var shouldShowWallet = walletLoading || !hideWalletChip;
|
|
898
|
+
if (!shouldShowLoyalty && !shouldShowSupercoin && !shouldShowWallet) {
|
|
899
|
+
return null;
|
|
900
|
+
}
|
|
735
901
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
736
902
|
display: 'flex',
|
|
737
903
|
padding: '0 16px 16px 16px',
|
|
@@ -764,7 +930,7 @@ var RewardsSection = function () {
|
|
|
764
930
|
}),
|
|
765
931
|
value: superCoinBalance,
|
|
766
932
|
handleChipClick: supercoinsChipClick,
|
|
767
|
-
type: '
|
|
933
|
+
type: 'supercoin'
|
|
768
934
|
}), walletLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
769
935
|
width: '50px',
|
|
770
936
|
height: '32px',
|
|
@@ -789,34 +955,51 @@ var AccountDropdownContent = function (_a) {
|
|
|
789
955
|
userName = _b.userName,
|
|
790
956
|
userMobileNumber = _b.userMobileNumber,
|
|
791
957
|
countryCode = _b.countryCode,
|
|
792
|
-
userDetailsLoading = _b.userDetailsLoading
|
|
958
|
+
userDetailsLoading = _b.userDetailsLoading,
|
|
959
|
+
loyaltyType = _b.loyaltyType,
|
|
960
|
+
isUserLoggedIn = _b.isUserLoggedIn,
|
|
961
|
+
ravenEventName = _b.ravenEventName,
|
|
962
|
+
ravenPageName = _b.ravenPageName,
|
|
963
|
+
_c = _b.ravenPayload,
|
|
964
|
+
ravenPayload = _c === void 0 ? {} : _c,
|
|
965
|
+
ravenPushCallback = _b.ravenPushCallback;
|
|
793
966
|
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
794
|
-
var
|
|
795
|
-
var userGreeting = userName && "Hello ".concat(userName, "!");
|
|
796
|
-
var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
|
|
967
|
+
var _d = react.useMemo(function () {
|
|
797
968
|
return {
|
|
798
|
-
userGreeting:
|
|
799
|
-
phoneNumber:
|
|
969
|
+
userGreeting: userName ? "Hello ".concat(userName, "!") : '',
|
|
970
|
+
phoneNumber: countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : ''
|
|
800
971
|
};
|
|
801
972
|
}, [userName, userMobileNumber, countryCode]),
|
|
802
|
-
userGreeting =
|
|
803
|
-
phoneNumber =
|
|
804
|
-
var
|
|
805
|
-
|
|
806
|
-
|
|
973
|
+
userGreeting = _d.userGreeting,
|
|
974
|
+
phoneNumber = _d.phoneNumber;
|
|
975
|
+
var generateRavenPayload = function (actionName) {
|
|
976
|
+
var _a;
|
|
977
|
+
return {
|
|
978
|
+
action_name: actionName.toLowerCase().replace(/[\s-]/g, '') + '_account_click',
|
|
979
|
+
action_type: 'click',
|
|
980
|
+
u_utm_source: (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic',
|
|
981
|
+
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
807
982
|
};
|
|
808
983
|
};
|
|
809
|
-
react.
|
|
984
|
+
var handleAccountOptionsClick = react.useCallback(function (text, redirectLink) {
|
|
985
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(text), ravenPayload, ravenPushCallback, ravenPageName);
|
|
986
|
+
window.location.href = redirectLink;
|
|
987
|
+
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
988
|
+
react.useCallback(function () {
|
|
989
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(SIGN_OUT_TEXT), ravenPayload, ravenPushCallback, ravenPageName);
|
|
990
|
+
handleLogoutClick();
|
|
991
|
+
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, handleLogoutClick]);
|
|
992
|
+
var positionAccountOptionsDiv = react.useCallback(function () {
|
|
810
993
|
var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
|
|
811
994
|
var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
|
|
812
|
-
|
|
813
|
-
var headerBtnRight = headerAccBtn
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
positionAccountOptionsDiv();
|
|
995
|
+
if (headerAccBtn && accountOptionsElem) {
|
|
996
|
+
var headerBtnRight = headerAccBtn.getBoundingClientRect().right;
|
|
997
|
+
accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
|
|
998
|
+
}
|
|
819
999
|
}, []);
|
|
1000
|
+
react.useEffect(function () {
|
|
1001
|
+
positionAccountOptionsDiv();
|
|
1002
|
+
}, [positionAccountOptionsDiv]);
|
|
820
1003
|
var renderUserData = function () {
|
|
821
1004
|
var renderContent = function (loading, content, variant, color) {
|
|
822
1005
|
return jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
@@ -863,7 +1046,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
863
1046
|
}, {
|
|
864
1047
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
865
1048
|
padding: '16px',
|
|
866
|
-
height: '
|
|
1049
|
+
height: '76px'
|
|
867
1050
|
}, {
|
|
868
1051
|
children: renderUserData()
|
|
869
1052
|
})), jsxRuntime.jsx(RewardsSection, {}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
@@ -872,7 +1055,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
872
1055
|
padding: '8px',
|
|
873
1056
|
backgroundColor: 'white',
|
|
874
1057
|
rowGap: '8px',
|
|
875
|
-
|
|
1058
|
+
css: {
|
|
876
1059
|
borderBottomLeftRadius: 12,
|
|
877
1060
|
borderBottomRightRadius: 12
|
|
878
1061
|
}
|
|
@@ -886,12 +1069,14 @@ var AccountDropdownContent = function (_a) {
|
|
|
886
1069
|
padding: '8px',
|
|
887
1070
|
borderRadius: '8px',
|
|
888
1071
|
cursor: 'pointer',
|
|
889
|
-
onClick:
|
|
1072
|
+
onClick: function () {
|
|
1073
|
+
return handleAccountOptionsClick(text, redirectionLink);
|
|
1074
|
+
}
|
|
890
1075
|
}, {
|
|
891
1076
|
children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
892
1077
|
display: 'flex',
|
|
893
1078
|
cursor: 'pointer',
|
|
894
|
-
|
|
1079
|
+
css: {
|
|
895
1080
|
columnGap: '8px'
|
|
896
1081
|
}
|
|
897
1082
|
}, {
|
|
@@ -908,7 +1093,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
908
1093
|
}))
|
|
909
1094
|
}), "account-option-".concat(text));
|
|
910
1095
|
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
911
|
-
|
|
1096
|
+
css: {
|
|
912
1097
|
borderBottom: '1px dashed #E6E6E6'
|
|
913
1098
|
}
|
|
914
1099
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
@@ -939,18 +1124,26 @@ var AccountDropdownContent = function (_a) {
|
|
|
939
1124
|
};
|
|
940
1125
|
|
|
941
1126
|
var UserAccount = function () {
|
|
942
|
-
var
|
|
943
|
-
|
|
1127
|
+
var _a = useHeaderContext(),
|
|
1128
|
+
isNovacThemeEnabled = _a.isNovacThemeEnabled,
|
|
1129
|
+
ravenEventName = _a.ravenEventName,
|
|
1130
|
+
_b = _a.ravenPayload,
|
|
1131
|
+
ravenPayload = _b === void 0 ? {} : _b,
|
|
1132
|
+
ravenPushCallback = _a.ravenPushCallback,
|
|
1133
|
+
isUserLoggedIn = _a.isUserLoggedIn,
|
|
1134
|
+
loyaltyType = _a.loyaltyType,
|
|
1135
|
+
ravenPageName = _a.ravenPageName;
|
|
1136
|
+
var _c = useHoverDropdown({
|
|
944
1137
|
openDelay: 0
|
|
945
1138
|
}),
|
|
946
|
-
isDropdownVisible =
|
|
947
|
-
handleOnMouseEnter =
|
|
948
|
-
handleOnMouseLeave =
|
|
949
|
-
handleDropdownMouseEnter =
|
|
950
|
-
handleDropdownMouseLeave =
|
|
951
|
-
var
|
|
952
|
-
scrolled =
|
|
953
|
-
setScrolled =
|
|
1139
|
+
isDropdownVisible = _c.isDropdownVisible,
|
|
1140
|
+
handleOnMouseEnter = _c.handleOnMouseEnter,
|
|
1141
|
+
handleOnMouseLeave = _c.handleOnMouseLeave,
|
|
1142
|
+
handleDropdownMouseEnter = _c.handleDropdownMouseEnter,
|
|
1143
|
+
handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
|
|
1144
|
+
var _d = react.useState(false),
|
|
1145
|
+
scrolled = _d[0],
|
|
1146
|
+
setScrolled = _d[1];
|
|
954
1147
|
react.useEffect(function () {
|
|
955
1148
|
var handleScroll = function () {
|
|
956
1149
|
setScrolled(window.scrollY >= 100);
|
|
@@ -960,8 +1153,20 @@ var UserAccount = function () {
|
|
|
960
1153
|
return window.removeEventListener('scroll', handleScroll);
|
|
961
1154
|
};
|
|
962
1155
|
}, []);
|
|
963
|
-
var
|
|
964
|
-
var hoverColor =
|
|
1156
|
+
var theme = isNovacThemeEnabled && !scrolled ? THEME_CONFIG.NOVAC : THEME_CONFIG.DEFAULT;
|
|
1157
|
+
var hoverColor = theme.hoverColor,
|
|
1158
|
+
typographyColor = theme.typographyColor;
|
|
1159
|
+
var triggerRavenEventOnHover = react.useCallback(function () {
|
|
1160
|
+
var _a;
|
|
1161
|
+
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
1162
|
+
var defaultPayload = {
|
|
1163
|
+
action_name: "".concat(MY_ACCOUNT_TEXT.toLowerCase().replace(/[\s-]/g, ''), "_header_hover"),
|
|
1164
|
+
action_type: 'hover',
|
|
1165
|
+
u_utm_source: utmSource,
|
|
1166
|
+
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
1167
|
+
};
|
|
1168
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1169
|
+
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
|
|
965
1170
|
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
966
1171
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
967
1172
|
display: 'flex',
|
|
@@ -970,18 +1175,19 @@ var UserAccount = function () {
|
|
|
970
1175
|
borderRadius: '12px',
|
|
971
1176
|
height: '100%',
|
|
972
1177
|
cursor: 'pointer',
|
|
973
|
-
|
|
1178
|
+
css: {
|
|
974
1179
|
columnGap: 8,
|
|
975
1180
|
height: 64
|
|
976
1181
|
},
|
|
977
1182
|
onMouseEnter: function () {
|
|
978
|
-
|
|
1183
|
+
handleOnMouseEnter(0);
|
|
1184
|
+
triggerRavenEventOnHover();
|
|
979
1185
|
},
|
|
980
1186
|
onMouseLeave: handleOnMouseLeave,
|
|
981
1187
|
id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
|
|
982
1188
|
}, {
|
|
983
1189
|
children: [jsxRuntime.jsx(ctDesignIcons.MyAccount, {
|
|
984
|
-
color: isDropdownVisible ? hoverColor :
|
|
1190
|
+
color: isDropdownVisible ? hoverColor : typographyColor
|
|
985
1191
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
986
1192
|
display: 'flex',
|
|
987
1193
|
flexDirection: 'row',
|
|
@@ -992,13 +1198,13 @@ var UserAccount = function () {
|
|
|
992
1198
|
css: {
|
|
993
1199
|
cursor: 'pointer'
|
|
994
1200
|
},
|
|
995
|
-
colorCode: isDropdownVisible ? hoverColor :
|
|
1201
|
+
colorCode: isDropdownVisible ? hoverColor : typographyColor
|
|
996
1202
|
}, {
|
|
997
|
-
children:
|
|
1203
|
+
children: MY_ACCOUNT_TEXT
|
|
998
1204
|
})), jsxRuntime.jsx(ctDesignIcons.ChevronDown, {
|
|
999
1205
|
width: 20,
|
|
1000
1206
|
height: 20,
|
|
1001
|
-
fill: isDropdownVisible ? hoverColor :
|
|
1207
|
+
fill: isDropdownVisible ? hoverColor : typographyColor
|
|
1002
1208
|
})]
|
|
1003
1209
|
}))]
|
|
1004
1210
|
})), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
@@ -1023,21 +1229,23 @@ var Header = function (props) {
|
|
|
1023
1229
|
}));
|
|
1024
1230
|
};
|
|
1025
1231
|
var HeaderContent = function () {
|
|
1026
|
-
var _a
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1232
|
+
var _a;
|
|
1233
|
+
var _b = useHeaderContext(),
|
|
1234
|
+
onLoginButtonClick = _b.onLoginButtonClick,
|
|
1235
|
+
_c = _b.showAllLobs,
|
|
1236
|
+
showAllLobs = _c === void 0 ? false : _c,
|
|
1237
|
+
isUserLoggedIn = _b.isUserLoggedIn,
|
|
1238
|
+
loyaltyType = _b.loyaltyType,
|
|
1239
|
+
_d = _b.isNovacThemeEnabled,
|
|
1240
|
+
isNovacThemeEnabled = _d === void 0 ? false : _d,
|
|
1241
|
+
_e = _b.ravenPayload,
|
|
1242
|
+
ravenPayload = _e === void 0 ? {} : _e,
|
|
1243
|
+
ravenPushCallback = _b.ravenPushCallback,
|
|
1244
|
+
ravenPageName = _b.ravenPageName,
|
|
1245
|
+
ravenEventName = _b.ravenEventName;
|
|
1246
|
+
var _f = react.useState(false),
|
|
1247
|
+
scrolled = _f[0],
|
|
1248
|
+
setScrolled = _f[1];
|
|
1041
1249
|
react.useEffect(function () {
|
|
1042
1250
|
var handleScroll = function () {
|
|
1043
1251
|
setScrolled(window.scrollY >= 100);
|
|
@@ -1047,18 +1255,49 @@ var HeaderContent = function () {
|
|
|
1047
1255
|
return window.removeEventListener('scroll', handleScroll);
|
|
1048
1256
|
};
|
|
1049
1257
|
}, []);
|
|
1050
|
-
var
|
|
1051
|
-
var headerBackground =
|
|
1052
|
-
|
|
1053
|
-
|
|
1258
|
+
var theme = isNovacThemeEnabled && !scrolled ? THEME_CONFIG.NOVAC : THEME_CONFIG.DEFAULT;
|
|
1259
|
+
var headerBackground = theme.headerBackground,
|
|
1260
|
+
logoFill = theme.logoFill,
|
|
1261
|
+
loginButtonColorVariant = theme.loginButtonColorVariant,
|
|
1262
|
+
hoverColor = theme.hoverColor,
|
|
1263
|
+
fkcompanyColor = theme.fkcompanyColor,
|
|
1264
|
+
typographyColor = theme.typographyColor;
|
|
1265
|
+
var _g = useHoverDropdown({
|
|
1054
1266
|
openDelay: 0
|
|
1055
1267
|
}),
|
|
1056
|
-
isDropdownVisible =
|
|
1057
|
-
hoveredElemIndex =
|
|
1058
|
-
handleOnMouseEnter =
|
|
1059
|
-
handleOnMouseLeave =
|
|
1060
|
-
handleDropdownMouseEnter =
|
|
1061
|
-
handleDropdownMouseLeave =
|
|
1268
|
+
isDropdownVisible = _g.isDropdownVisible,
|
|
1269
|
+
hoveredElemIndex = _g.hoveredElemIndex,
|
|
1270
|
+
handleOnMouseEnter = _g.handleOnMouseEnter,
|
|
1271
|
+
handleOnMouseLeave = _g.handleOnMouseLeave,
|
|
1272
|
+
handleDropdownMouseEnter = _g.handleDropdownMouseEnter,
|
|
1273
|
+
handleDropdownMouseLeave = _g.handleDropdownMouseLeave;
|
|
1274
|
+
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
1275
|
+
var createPayload = react.useCallback(function (actionName, actionType) {
|
|
1276
|
+
return {
|
|
1277
|
+
action_name: actionName,
|
|
1278
|
+
action_type: actionType,
|
|
1279
|
+
u_utm_source: utmSource,
|
|
1280
|
+
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
1281
|
+
};
|
|
1282
|
+
}, [utmSource, loyaltyType]);
|
|
1283
|
+
var handleNavbarOptionsClick = react.useCallback(function (option) {
|
|
1284
|
+
if (option.isClickable && option.link) {
|
|
1285
|
+
var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_click");
|
|
1286
|
+
var payload = createPayload(actionName, 'click');
|
|
1287
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1288
|
+
window.location.href = option.link;
|
|
1289
|
+
}
|
|
1290
|
+
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1291
|
+
var handleHomeClick = react.useCallback(function () {
|
|
1292
|
+
var payload = createPayload('home_header_click', 'click');
|
|
1293
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1294
|
+
window.location.href = '/';
|
|
1295
|
+
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1296
|
+
var triggerRavenEventOnHover = react.useCallback(function (option) {
|
|
1297
|
+
var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_hover");
|
|
1298
|
+
var payload = createPayload(actionName, 'hover');
|
|
1299
|
+
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1300
|
+
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1062
1301
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1063
1302
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
1064
1303
|
display: 'flex',
|
|
@@ -1073,7 +1312,7 @@ var HeaderContent = function () {
|
|
|
1073
1312
|
css: {
|
|
1074
1313
|
gap: '24px',
|
|
1075
1314
|
flexShrink: 0,
|
|
1076
|
-
borderBottom:
|
|
1315
|
+
borderBottom: headerBackground === 'transparent' ? '' : '1px solid #E6E6E6',
|
|
1077
1316
|
transition: 'background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out'
|
|
1078
1317
|
}
|
|
1079
1318
|
}, {
|
|
@@ -1083,7 +1322,7 @@ var HeaderContent = function () {
|
|
|
1083
1322
|
justifyContent: 'space-between',
|
|
1084
1323
|
padding: '0 28px',
|
|
1085
1324
|
flex: 1,
|
|
1086
|
-
|
|
1325
|
+
css: {
|
|
1087
1326
|
gap: '24px',
|
|
1088
1327
|
maxWidth: 1440
|
|
1089
1328
|
}
|
|
@@ -1094,13 +1333,10 @@ var HeaderContent = function () {
|
|
|
1094
1333
|
alignItems: 'center',
|
|
1095
1334
|
justifyContent: 'center',
|
|
1096
1335
|
cursor: 'pointer',
|
|
1097
|
-
|
|
1098
|
-
onClick: function () {
|
|
1099
|
-
window.location.href = '/';
|
|
1100
|
-
}
|
|
1336
|
+
onClick: handleHomeClick
|
|
1101
1337
|
}, {
|
|
1102
1338
|
children: [jsxRuntime.jsx(ctDesignIcons.CTLogo, {
|
|
1103
|
-
fillColor:
|
|
1339
|
+
fillColor: logoFill
|
|
1104
1340
|
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1105
1341
|
css: {
|
|
1106
1342
|
width: 12,
|
|
@@ -1110,7 +1346,7 @@ var HeaderContent = function () {
|
|
|
1110
1346
|
borderBottom: '1px solid #e0e0e0'
|
|
1111
1347
|
}
|
|
1112
1348
|
}), jsxRuntime.jsx(ctDesignIcons.Fkcompany, {
|
|
1113
|
-
color:
|
|
1349
|
+
color: fkcompanyColor
|
|
1114
1350
|
})]
|
|
1115
1351
|
})), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1116
1352
|
display: 'flex',
|
|
@@ -1127,11 +1363,18 @@ var HeaderContent = function () {
|
|
|
1127
1363
|
columnGap: '4px'
|
|
1128
1364
|
}, {
|
|
1129
1365
|
children: NAVBAR_OPTIONS.map(function (option, index) {
|
|
1366
|
+
var text = option.text,
|
|
1367
|
+
LeftIcon = option.lefticon,
|
|
1368
|
+
RightIcon = option.rightIcon,
|
|
1369
|
+
isHoverable = option.isHoverable;
|
|
1130
1370
|
var isHovered = hoveredElemIndex === index;
|
|
1131
1371
|
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
1132
1372
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1133
1373
|
onMouseEnter: function () {
|
|
1134
|
-
|
|
1374
|
+
handleOnMouseEnter(index);
|
|
1375
|
+
if (option.isHoverable) {
|
|
1376
|
+
triggerRavenEventOnHover(option);
|
|
1377
|
+
}
|
|
1135
1378
|
},
|
|
1136
1379
|
onMouseLeave: handleOnMouseLeave,
|
|
1137
1380
|
display: 'flex',
|
|
@@ -1143,13 +1386,11 @@ var HeaderContent = function () {
|
|
|
1143
1386
|
columnGap: 8,
|
|
1144
1387
|
height: '64px',
|
|
1145
1388
|
onClick: function () {
|
|
1146
|
-
|
|
1147
|
-
window.location.href = option.link;
|
|
1148
|
-
}
|
|
1389
|
+
return handleNavbarOptionsClick(option);
|
|
1149
1390
|
}
|
|
1150
1391
|
}, {
|
|
1151
|
-
children: [jsxRuntime.jsx(
|
|
1152
|
-
color: isHovered ? hoverColor :
|
|
1392
|
+
children: [jsxRuntime.jsx(LeftIcon, {
|
|
1393
|
+
color: isHovered ? hoverColor : typographyColor
|
|
1153
1394
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1154
1395
|
display: 'flex',
|
|
1155
1396
|
flexDirection: 'row',
|
|
@@ -1157,31 +1398,31 @@ var HeaderContent = function () {
|
|
|
1157
1398
|
}, {
|
|
1158
1399
|
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1159
1400
|
variant: 'B2',
|
|
1160
|
-
colorCode: isHovered ? hoverColor :
|
|
1401
|
+
colorCode: isHovered ? hoverColor : typographyColor,
|
|
1161
1402
|
isClickable: true
|
|
1162
1403
|
}, {
|
|
1163
|
-
children:
|
|
1164
|
-
})),
|
|
1404
|
+
children: text
|
|
1405
|
+
})), RightIcon && jsxRuntime.jsx(RightIcon, {
|
|
1165
1406
|
width: 20,
|
|
1166
1407
|
height: 20,
|
|
1167
|
-
fill: isHovered ? hoverColor :
|
|
1408
|
+
fill: isHovered ? hoverColor : typographyColor
|
|
1168
1409
|
})]
|
|
1169
1410
|
}))]
|
|
1170
1411
|
}), "nav-option-".concat(index)), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
1171
|
-
show: hoveredElemIndex === index &&
|
|
1412
|
+
show: hoveredElemIndex === index && isHoverable && isDropdownVisible,
|
|
1172
1413
|
marginTop: '64px',
|
|
1173
1414
|
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
1174
1415
|
handleDropdownMouseLeave: handleDropdownMouseLeave,
|
|
1175
1416
|
onMaskClick: handleDropdownMouseLeave
|
|
1176
1417
|
}, {
|
|
1177
1418
|
children: jsxRuntime.jsx(BusinessDropdownContent, {
|
|
1178
|
-
isOpen: hoveredElemIndex === index &&
|
|
1419
|
+
isOpen: hoveredElemIndex === index && isHoverable && isDropdownVisible
|
|
1179
1420
|
})
|
|
1180
1421
|
}))]
|
|
1181
1422
|
});
|
|
1182
1423
|
})
|
|
1183
1424
|
})), isUserLoggedIn && jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1184
|
-
|
|
1425
|
+
css: {
|
|
1185
1426
|
width: 12,
|
|
1186
1427
|
margin: '0 -18px',
|
|
1187
1428
|
transform: 'rotate(90deg)',
|
|
@@ -1195,21 +1436,22 @@ var HeaderContent = function () {
|
|
|
1195
1436
|
}, {
|
|
1196
1437
|
children: jsxRuntime.jsx(UserAccount, {})
|
|
1197
1438
|
})) : jsxRuntime.jsx(ctDesignButton.Button, tslib.__assign({
|
|
1198
|
-
|
|
1439
|
+
variant: 'outline',
|
|
1440
|
+
color: loginButtonColorVariant,
|
|
1441
|
+
className: "".concat(headerBackground === 'transparent' ? 'novac-login-button' : 'login-button'),
|
|
1199
1442
|
onClick: onLoginButtonClick,
|
|
1200
|
-
|
|
1443
|
+
css: {
|
|
1201
1444
|
width: 153,
|
|
1202
|
-
height: 40
|
|
1203
|
-
border: effectiveNovacThemeEnabled ? '1px solid #FFF' : '1px solid #1A1A1A'
|
|
1445
|
+
height: 40
|
|
1204
1446
|
},
|
|
1205
1447
|
loading: false
|
|
1206
1448
|
}, {
|
|
1207
1449
|
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1208
1450
|
componentNode: 'span',
|
|
1209
1451
|
variant: 'L2',
|
|
1210
|
-
color:
|
|
1452
|
+
color: loginButtonColorVariant === ctDesignButton.ButtonColor.NEUTRAL ? 'neutral' : 'primary'
|
|
1211
1453
|
}, {
|
|
1212
|
-
children:
|
|
1454
|
+
children: LOG_IN_TEXT
|
|
1213
1455
|
}))
|
|
1214
1456
|
}))
|
|
1215
1457
|
})]
|