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