@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-v0.8.0 → 1.2.0-SNAPSHOT-header-v0.9.0.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 +0 -1
- package/dist/UserAccount/accountOptions.d.ts.map +1 -1
- package/dist/UserAccount/index.d.ts.map +1 -1
- package/dist/constants.d.ts +31 -34
- 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 +196 -451
- package/dist/ct-design-header.cjs.js.map +1 -1
- package/dist/ct-design-header.esm.js +197 -452
- package/dist/ct-design-header.esm.js.map +1 -1
- package/dist/ct-design-header.umd.js +200 -454
- package/dist/ct-design-header.umd.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/type.d.ts +1 -17
- package/dist/type.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/utils.d.ts +0 -8
- package/dist/utils.d.ts.map +0 -1
|
@@ -8,7 +8,6 @@ var ctDesignTypography = require('@cleartrip/ct-design-typography');
|
|
|
8
8
|
var ctDesignButton = require('@cleartrip/ct-design-button');
|
|
9
9
|
var ctDesignDivider = require('@cleartrip/ct-design-divider');
|
|
10
10
|
var ctDesignIcons = require('@cleartrip/ct-design-icons');
|
|
11
|
-
var ctDesignShimmer = require('@cleartrip/ct-design-shimmer');
|
|
12
11
|
|
|
13
12
|
var OFFERS_URL = 'all-offers/?categories=flights';
|
|
14
13
|
var MY_TRIPS_URL = '/account/trips';
|
|
@@ -16,27 +15,23 @@ var SUPPORT_URL = '/support';
|
|
|
16
15
|
var NAVBAR_OPTIONS = [{
|
|
17
16
|
lefticon: ctDesignIcons.Offers,
|
|
18
17
|
text: 'Offers',
|
|
19
|
-
ravenActionName: 'offers',
|
|
20
18
|
isHoverable: false,
|
|
21
19
|
isClickable: true,
|
|
22
20
|
link: OFFERS_URL
|
|
23
21
|
}, {
|
|
24
22
|
lefticon: ctDesignIcons.BusinessBag,
|
|
25
23
|
text: 'Business',
|
|
26
|
-
ravenActionName: 'business',
|
|
27
24
|
rightIcon: ctDesignIcons.ChevronDown,
|
|
28
25
|
isHoverable: true
|
|
29
26
|
}, {
|
|
30
27
|
lefticon: ctDesignIcons.MyTrips,
|
|
31
28
|
text: 'My Trips',
|
|
32
|
-
ravenActionName: 'mytrips',
|
|
33
29
|
isHoverable: false,
|
|
34
30
|
isClickable: true,
|
|
35
31
|
link: MY_TRIPS_URL
|
|
36
32
|
}, {
|
|
37
33
|
lefticon: ctDesignIcons.SupportIcon,
|
|
38
34
|
text: 'Support',
|
|
39
|
-
ravenActionName: 'support',
|
|
40
35
|
isHoverable: false,
|
|
41
36
|
isClickable: true,
|
|
42
37
|
link: SUPPORT_URL
|
|
@@ -50,36 +45,33 @@ var LOBS = {
|
|
|
50
45
|
};
|
|
51
46
|
var LOB_DATA = [{
|
|
52
47
|
title: LOBS.FLIGHTS,
|
|
53
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
48
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/flight_uhp.png?cache=true',
|
|
54
49
|
link: '/flights'
|
|
55
50
|
}, {
|
|
56
51
|
title: LOBS.HOTELS,
|
|
57
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
52
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/hotel_uhp.png?cache=true',
|
|
58
53
|
link: '/hotels'
|
|
59
54
|
}, {
|
|
60
55
|
title: LOBS.BUSES,
|
|
61
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
56
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/bus_uhp.png?cache=true',
|
|
62
57
|
link: '/bus'
|
|
63
58
|
}, {
|
|
64
59
|
title: LOBS.TRAIN,
|
|
65
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
60
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/train_uhp.png?cache=true',
|
|
66
61
|
link: '/pages/trains/appOnly'
|
|
67
62
|
}, {
|
|
68
63
|
title: LOBS.PACKAGES,
|
|
69
|
-
image: 'https://rukmini-ct.flixcart.com/f_auto,
|
|
64
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/holiday_uhp.png?cache=true',
|
|
70
65
|
link: '/holidays'
|
|
71
66
|
}];
|
|
72
67
|
var bdConfig = [{
|
|
73
68
|
title: 'AgentBox',
|
|
74
69
|
subtitle: 'For travel agents',
|
|
75
|
-
details: 'One-stop travel solution offering the best deals to our travel agency partners'
|
|
76
|
-
link: 'https://agency.cleartrip.com'
|
|
70
|
+
details: 'One-stop travel solution offering the best deals to our travel agency partners'
|
|
77
71
|
}, {
|
|
78
72
|
title: 'OutOfOffice',
|
|
79
73
|
subtitle: 'For startups, corporates and SMEs',
|
|
80
|
-
details: 'Manage corporate business travel, smartly'
|
|
81
|
-
link: 'https://ooo.cleartrip.com/',
|
|
82
|
-
ravenActionName: 'ooo'
|
|
74
|
+
details: 'Manage corporate business travel, smartly'
|
|
83
75
|
}, {
|
|
84
76
|
title: 'MICE',
|
|
85
77
|
subtitle: 'For corporate events',
|
|
@@ -92,35 +84,16 @@ var bdConfig = [{
|
|
|
92
84
|
link: 'https://business.cleartrip.com/api-customers/more-details'
|
|
93
85
|
}];
|
|
94
86
|
var BUSINESS_DROPDOWN_HEADING = 'Other business services';
|
|
95
|
-
|
|
87
|
+
var RAVEN_PAGE_NAMES;
|
|
96
88
|
(function (RAVEN_PAGE_NAMES) {
|
|
97
89
|
RAVEN_PAGE_NAMES["UNIFIED_HOME"] = "unified_homepage";
|
|
98
|
-
RAVEN_PAGE_NAMES["HOTELS_HOME"] = "
|
|
99
|
-
RAVEN_PAGE_NAMES["FLIGHTS_HOME"] = "
|
|
100
|
-
})(
|
|
90
|
+
RAVEN_PAGE_NAMES["HOTELS_HOME"] = "hotels_homepage";
|
|
91
|
+
RAVEN_PAGE_NAMES["FLIGHTS_HOME"] = "flights_homepage";
|
|
92
|
+
})(RAVEN_PAGE_NAMES || (RAVEN_PAGE_NAMES = {}));
|
|
101
93
|
var RAVEN_PLATFORMS;
|
|
102
94
|
(function (RAVEN_PLATFORMS) {
|
|
103
95
|
RAVEN_PLATFORMS["DESKTOP"] = "desktop";
|
|
104
96
|
})(RAVEN_PLATFORMS || (RAVEN_PLATFORMS = {}));
|
|
105
|
-
var LOG_IN_TEXT = 'Log in';
|
|
106
|
-
var THEME_CONFIG = {
|
|
107
|
-
NOVAC: {
|
|
108
|
-
headerBackground: 'transparent',
|
|
109
|
-
hoverColor: '#FDBA12',
|
|
110
|
-
logoFill: '#FFF',
|
|
111
|
-
fkcompanyColor: '#FFF',
|
|
112
|
-
typographyColor: '#FFF',
|
|
113
|
-
loginButtonColorVariant: ctDesignButton.ButtonColor.NEUTRAL
|
|
114
|
-
},
|
|
115
|
-
DEFAULT: {
|
|
116
|
-
headerBackground: '#FFFFFF',
|
|
117
|
-
hoverColor: '#FF4F17',
|
|
118
|
-
logoFill: '#FF4F17',
|
|
119
|
-
fkcompanyColor: '#1A1A1A',
|
|
120
|
-
typographyColor: '#1A1A1A',
|
|
121
|
-
loginButtonColorVariant: ctDesignButton.ButtonColor.PRIMARY
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
97
|
|
|
125
98
|
var HeaderContext = react.createContext(undefined);
|
|
126
99
|
var useHeaderContext = function () {
|
|
@@ -147,54 +120,44 @@ var LobsHeader = function () {
|
|
|
147
120
|
alignItems: 'center',
|
|
148
121
|
justifyContent: 'center',
|
|
149
122
|
padding: '16px',
|
|
150
|
-
|
|
123
|
+
height: '64',
|
|
124
|
+
background: '#F3F5FA',
|
|
151
125
|
top: '64px',
|
|
152
126
|
zIndex: 2,
|
|
153
127
|
css: {
|
|
154
|
-
gap:
|
|
128
|
+
gap: 40
|
|
155
129
|
}
|
|
156
130
|
}, {
|
|
157
131
|
children: LOB_DATA.map(function (item, index) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
132
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
133
|
+
display: 'flex',
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
cursor: 'pointer',
|
|
136
|
+
css: {
|
|
137
|
+
gap: 8,
|
|
138
|
+
background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
|
|
139
|
+
borderRadius: selectedLOB === item.title ? '40px' : '0',
|
|
140
|
+
padding: selectedLOB === item.title ? '8px 16px 8px 8px' : '0'
|
|
141
|
+
},
|
|
142
|
+
onClick: function () {
|
|
143
|
+
window.location.href = item.link;
|
|
167
144
|
}
|
|
168
145
|
}, {
|
|
169
|
-
children: jsxRuntime.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
width:
|
|
173
|
-
height:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
borderRadius: '40px',
|
|
181
|
-
padding: '8px 16px 8px 8px',
|
|
182
|
-
transition: 'background 0.2s ease'
|
|
183
|
-
}
|
|
146
|
+
children: [jsxRuntime.jsx("img", {
|
|
147
|
+
src: item.image,
|
|
148
|
+
alt: item.title,
|
|
149
|
+
width: 32,
|
|
150
|
+
height: 32
|
|
151
|
+
}), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
152
|
+
variant: 'P1',
|
|
153
|
+
style: {
|
|
154
|
+
fontWeight: selectedLOB === item.title ? 600 : 500
|
|
155
|
+
},
|
|
156
|
+
isClickable: true
|
|
184
157
|
}, {
|
|
185
|
-
children:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
width: 32,
|
|
189
|
-
height: 32
|
|
190
|
-
}), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
191
|
-
variant: isSelected ? ctDesignTypography.TypographyVariant.HM3 : ctDesignTypography.TypographyVariant.B1,
|
|
192
|
-
isClickable: true
|
|
193
|
-
}, {
|
|
194
|
-
children: title
|
|
195
|
-
}))]
|
|
196
|
-
}), index)
|
|
197
|
-
}));
|
|
158
|
+
children: item.title
|
|
159
|
+
}))]
|
|
160
|
+
}), index);
|
|
198
161
|
})
|
|
199
162
|
}));
|
|
200
163
|
};
|
|
@@ -393,85 +356,11 @@ var useDropdownAnimation = function (isOpen) {
|
|
|
393
356
|
};
|
|
394
357
|
};
|
|
395
358
|
|
|
396
|
-
var stringifyPayload = function (payload) {
|
|
397
|
-
var keys = Object.keys(payload);
|
|
398
|
-
var numericValues = [];
|
|
399
|
-
keys.forEach(function (key) {
|
|
400
|
-
if (numericValues.includes(key)) {
|
|
401
|
-
payload[key] = Number(payload[key]);
|
|
402
|
-
} else {
|
|
403
|
-
payload[key] = '' + payload[key];
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
return payload;
|
|
407
|
-
};
|
|
408
|
-
var isServer = function () {
|
|
409
|
-
return typeof window === 'undefined' || !window;
|
|
410
|
-
};
|
|
411
|
-
var getQueryParam = function (queryParam) {
|
|
412
|
-
if (isServer()) {
|
|
413
|
-
return '';
|
|
414
|
-
}
|
|
415
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
416
|
-
return urlParams.get(queryParam);
|
|
417
|
-
};
|
|
418
|
-
var ravenLoyaltyTypes = function (loyaltyType) {
|
|
419
|
-
switch (loyaltyType) {
|
|
420
|
-
case 'FkVip':
|
|
421
|
-
return 'fk_vip';
|
|
422
|
-
case 'FkPremium':
|
|
423
|
-
return 'fk_plus_premium';
|
|
424
|
-
case 'InsiderIcon':
|
|
425
|
-
return 'myntra_insidericon';
|
|
426
|
-
case 'InsiderElite':
|
|
427
|
-
return 'myntra_insiderelite';
|
|
428
|
-
default:
|
|
429
|
-
return '';
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
var ravenSDKTrigger = function (isUserLoggedIn, eventName, ravenPayload, customRavenPayload, ravenPushCallback, pageName) {
|
|
433
|
-
var _a;
|
|
434
|
-
if (typeof ravenPushCallback !== 'function') {
|
|
435
|
-
console.error('ravenPushCallback is not provided or is not a function');
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
var commonPayload = {
|
|
439
|
-
page_name: pageName,
|
|
440
|
-
platform: RAVEN_PLATFORMS.DESKTOP,
|
|
441
|
-
login_status: isUserLoggedIn ? 'yes' : 'no',
|
|
442
|
-
domain: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host
|
|
443
|
-
};
|
|
444
|
-
var newRavenPayload = stringifyPayload(ravenPayload);
|
|
445
|
-
var parsedCustomRavenPayload = stringifyPayload(customRavenPayload);
|
|
446
|
-
var finalPayload = tslib.__assign(tslib.__assign(tslib.__assign({}, commonPayload), newRavenPayload), parsedCustomRavenPayload);
|
|
447
|
-
try {
|
|
448
|
-
if (ravenPushCallback.length === 1) {
|
|
449
|
-
ravenPushCallback({
|
|
450
|
-
eventName: eventName,
|
|
451
|
-
eventData: finalPayload
|
|
452
|
-
});
|
|
453
|
-
} else {
|
|
454
|
-
ravenPushCallback(eventName, finalPayload);
|
|
455
|
-
}
|
|
456
|
-
} catch (err) {
|
|
457
|
-
console.error(err);
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
|
|
462
359
|
var BusinessDropdownContent = function (_a) {
|
|
463
360
|
var isOpen = _a.isOpen;
|
|
464
|
-
var _b =
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
ravenPageName = _b.ravenPageName,
|
|
468
|
-
ravenEventName = _b.ravenEventName,
|
|
469
|
-
loyaltyType = _b.loyaltyType,
|
|
470
|
-
_c = _b.ravenPayload,
|
|
471
|
-
ravenPayload = _c === void 0 ? {} : _c;
|
|
472
|
-
var _d = react.useState(0),
|
|
473
|
-
leftPosition = _d[0],
|
|
474
|
-
setLeftPosition = _d[1];
|
|
361
|
+
var _b = react.useState(0),
|
|
362
|
+
leftPosition = _b[0],
|
|
363
|
+
setLeftPosition = _b[1];
|
|
475
364
|
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
476
365
|
react.useEffect(function () {
|
|
477
366
|
var updatePosition = function () {
|
|
@@ -490,21 +379,6 @@ var BusinessDropdownContent = function (_a) {
|
|
|
490
379
|
return window.removeEventListener('resize', updatePosition);
|
|
491
380
|
};
|
|
492
381
|
}, [containerRef, leftPosition]);
|
|
493
|
-
var handleBusinessDropdownClick = react.useCallback(function (link, title, ravenActionName) {
|
|
494
|
-
var _a;
|
|
495
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
496
|
-
var actionName = ravenActionName ? "".concat(ravenActionName, "_business_click") : title ? "".concat(title.toLowerCase(), "_business_click") : '';
|
|
497
|
-
var defaultPayload = {
|
|
498
|
-
action_name: actionName,
|
|
499
|
-
action_type: 'click',
|
|
500
|
-
u_utm_source: utmSource,
|
|
501
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
502
|
-
};
|
|
503
|
-
if (link) {
|
|
504
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
505
|
-
window.location.href = link;
|
|
506
|
-
}
|
|
507
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
|
|
508
382
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
509
383
|
ref: containerRef,
|
|
510
384
|
backgroundColor: '#fff',
|
|
@@ -525,7 +399,10 @@ var BusinessDropdownContent = function (_a) {
|
|
|
525
399
|
backgroundColor: '#FFF1EC'
|
|
526
400
|
}, {
|
|
527
401
|
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
528
|
-
variant: 'HM2'
|
|
402
|
+
variant: 'HM2',
|
|
403
|
+
css: {
|
|
404
|
+
lineHeight: '24px'
|
|
405
|
+
}
|
|
529
406
|
}, {
|
|
530
407
|
children: BUSINESS_DROPDOWN_HEADING
|
|
531
408
|
}))
|
|
@@ -539,46 +416,32 @@ var BusinessDropdownContent = function (_a) {
|
|
|
539
416
|
children: bdConfig.map(function (_a) {
|
|
540
417
|
var title = _a.title,
|
|
541
418
|
subtitle = _a.subtitle,
|
|
542
|
-
details = _a.details
|
|
543
|
-
link = _a.link,
|
|
544
|
-
ravenActionName = _a.ravenActionName;
|
|
419
|
+
details = _a.details;
|
|
545
420
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
546
421
|
cursor: 'pointer',
|
|
547
|
-
display: 'flex',
|
|
548
|
-
flexDirection: 'column',
|
|
549
422
|
width: '200px',
|
|
550
|
-
|
|
551
|
-
className: 'bd-hover-container',
|
|
552
|
-
onClick: function () {
|
|
553
|
-
return handleBusinessDropdownClick(link, title, ravenActionName);
|
|
554
|
-
}
|
|
423
|
+
className: 'bd-hover-container'
|
|
555
424
|
}, {
|
|
556
425
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
557
426
|
display: 'flex',
|
|
558
|
-
flexDirection: '
|
|
559
|
-
|
|
427
|
+
flexDirection: 'row',
|
|
428
|
+
alignItems: 'center',
|
|
429
|
+
columnGap: '8px'
|
|
560
430
|
}, {
|
|
561
|
-
children: [jsxRuntime.
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
alignItems: 'center',
|
|
565
|
-
columnGap: '8px'
|
|
431
|
+
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
432
|
+
variant: 'HM2',
|
|
433
|
+
className: 'color-orange-on-hover'
|
|
566
434
|
}, {
|
|
567
|
-
children:
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
opacity: 0.75
|
|
578
|
-
}
|
|
579
|
-
}, {
|
|
580
|
-
children: subtitle
|
|
581
|
-
}))]
|
|
435
|
+
children: title
|
|
436
|
+
})), jsxRuntime.jsx(AnimatedArrow, {})]
|
|
437
|
+
})), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
438
|
+
variant: 'B3',
|
|
439
|
+
css: {
|
|
440
|
+
marginTop: '4px',
|
|
441
|
+
opacity: 0.75
|
|
442
|
+
}
|
|
443
|
+
}, {
|
|
444
|
+
children: subtitle
|
|
582
445
|
})), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
583
446
|
variant: 'P3',
|
|
584
447
|
color: 'subheading',
|
|
@@ -656,7 +519,6 @@ var ACCOUNT_OPTIONS_POPUP_CONFIG = [{
|
|
|
656
519
|
redirectionLink: 'accounts/personal-data-dashboard'
|
|
657
520
|
}];
|
|
658
521
|
var SIGN_OUT_TEXT = 'Logout';
|
|
659
|
-
var MY_ACCOUNT_TEXT = 'My Account';
|
|
660
522
|
var LOGGEDIN_USER_TEXT = 'You are logged in with';
|
|
661
523
|
var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
|
|
662
524
|
var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
|
|
@@ -668,33 +530,13 @@ var LoyaltyChip = function (_a) {
|
|
|
668
530
|
backgroundGradient = _a.backgroundGradient,
|
|
669
531
|
handleChipClick = _a.handleChipClick,
|
|
670
532
|
chevronFillColor = _a.chevronFillColor;
|
|
671
|
-
var _b =
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
ravenEventName = _b.ravenEventName;
|
|
679
|
-
var _d = react.useState(false),
|
|
680
|
-
isHovered = _d[0],
|
|
681
|
-
setIsHovered = _d[1];
|
|
682
|
-
var handleClick = react.useCallback(function () {
|
|
683
|
-
var _a;
|
|
684
|
-
if (handleChipClick) {
|
|
685
|
-
handleChipClick();
|
|
686
|
-
} else {
|
|
687
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
688
|
-
var defaultPayload = {
|
|
689
|
-
action_name: "loyalty_account_click",
|
|
690
|
-
action_type: 'click',
|
|
691
|
-
u_utm_source: utmSource,
|
|
692
|
-
loyaltyType: ravenLoyaltyTypes(loyaltyType)
|
|
693
|
-
};
|
|
694
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
695
|
-
window.location.href = '/all-offers/loyalty-october';
|
|
696
|
-
}
|
|
697
|
-
}, [handleChipClick, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
533
|
+
var _b = react.useState(false),
|
|
534
|
+
isHovered = _b[0],
|
|
535
|
+
setIsHovered = _b[1];
|
|
536
|
+
var handleClick = function () {
|
|
537
|
+
window.location.href = '/';
|
|
538
|
+
handleChipClick && handleChipClick();
|
|
539
|
+
};
|
|
698
540
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
699
541
|
display: 'flex',
|
|
700
542
|
position: 'relative',
|
|
@@ -719,7 +561,7 @@ var LoyaltyChip = function (_a) {
|
|
|
719
561
|
onClick: handleClick
|
|
720
562
|
}, {
|
|
721
563
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
722
|
-
|
|
564
|
+
style: {
|
|
723
565
|
content: '""',
|
|
724
566
|
position: 'absolute',
|
|
725
567
|
inset: 0,
|
|
@@ -728,7 +570,7 @@ var LoyaltyChip = function (_a) {
|
|
|
728
570
|
zIndex: -2
|
|
729
571
|
}
|
|
730
572
|
}), jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
731
|
-
|
|
573
|
+
style: {
|
|
732
574
|
content: '""',
|
|
733
575
|
position: 'absolute',
|
|
734
576
|
inset: 0,
|
|
@@ -749,7 +591,7 @@ var LoyaltyChip = function (_a) {
|
|
|
749
591
|
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
750
592
|
display: 'flex',
|
|
751
593
|
alignItems: 'center',
|
|
752
|
-
|
|
594
|
+
style: {
|
|
753
595
|
overflow: 'hidden',
|
|
754
596
|
maxWidth: isHovered ? 16 : 0,
|
|
755
597
|
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
@@ -814,46 +656,24 @@ var ExpandableItem = function (_a) {
|
|
|
814
656
|
handleChipClick = _a.handleChipClick,
|
|
815
657
|
value = _a.value,
|
|
816
658
|
type = _a.type;
|
|
817
|
-
var _b =
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
var _d = react.useState(false),
|
|
826
|
-
isHovered = _d[0],
|
|
827
|
-
setIsHovered = _d[1];
|
|
828
|
-
var handleDefaultClick = react.useCallback(function () {
|
|
829
|
-
var _a;
|
|
830
|
-
if (handleChipClick) {
|
|
831
|
-
handleChipClick();
|
|
832
|
-
} else {
|
|
833
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
834
|
-
var defaultPayload = {
|
|
835
|
-
action_name: "".concat(type, "_account_click"),
|
|
836
|
-
action_type: 'click',
|
|
837
|
-
u_utm_source: utmSource,
|
|
838
|
-
loyaltyType: ravenLoyaltyTypes(loyaltyType)
|
|
839
|
-
};
|
|
840
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
841
|
-
var redirectUrls = {
|
|
842
|
-
supercoin: '/all-offers/supercoins/',
|
|
843
|
-
wallet: '/accounts/wallet'
|
|
844
|
-
};
|
|
845
|
-
if (redirectUrls[type]) {
|
|
846
|
-
window.location.href = redirectUrls[type];
|
|
847
|
-
}
|
|
659
|
+
var _b = react.useState(false),
|
|
660
|
+
isHovered = _b[0],
|
|
661
|
+
setIsHovered = _b[1];
|
|
662
|
+
var handleDefaultClick = function () {
|
|
663
|
+
if (type === 'supercoins') {
|
|
664
|
+
window.location.href = '/supercoins';
|
|
665
|
+
} else if (type === 'wallet') {
|
|
666
|
+
window.location.href = '/wallet';
|
|
848
667
|
}
|
|
849
|
-
|
|
668
|
+
handleChipClick && handleChipClick();
|
|
669
|
+
};
|
|
850
670
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
851
671
|
display: 'flex',
|
|
852
672
|
alignItems: 'center',
|
|
853
673
|
justifyContent: 'center',
|
|
854
674
|
borderRadius: '8px',
|
|
855
675
|
cursor: 'pointer',
|
|
856
|
-
|
|
676
|
+
style: {
|
|
857
677
|
height: 32,
|
|
858
678
|
paddingLeft: 8,
|
|
859
679
|
paddingRight: isHovered ? 4 : 8,
|
|
@@ -884,7 +704,7 @@ var ExpandableItem = function (_a) {
|
|
|
884
704
|
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
885
705
|
display: 'flex',
|
|
886
706
|
alignItems: 'center',
|
|
887
|
-
|
|
707
|
+
style: {
|
|
888
708
|
overflow: 'hidden',
|
|
889
709
|
maxWidth: isHovered ? 16 : 0,
|
|
890
710
|
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
@@ -912,12 +732,6 @@ var RewardsSection = function () {
|
|
|
912
732
|
hideWalletChip = _b.hideWalletChip,
|
|
913
733
|
hideSupercoinsChip = _b.hideSupercoinsChip,
|
|
914
734
|
hideLoyaltyChip = _b.hideLoyaltyChip;
|
|
915
|
-
var shouldShowLoyalty = loyaltyLoading || selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && !hideLoyaltyChip;
|
|
916
|
-
var shouldShowSupercoin = superCoinsLoading || !hideSupercoinsChip;
|
|
917
|
-
var shouldShowWallet = walletLoading || !hideWalletChip;
|
|
918
|
-
if (!shouldShowLoyalty && !shouldShowSupercoin && !shouldShowWallet) {
|
|
919
|
-
return null;
|
|
920
|
-
}
|
|
921
735
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
922
736
|
display: 'flex',
|
|
923
737
|
padding: '0 16px 16px 16px',
|
|
@@ -927,20 +741,22 @@ var RewardsSection = function () {
|
|
|
927
741
|
gap: '4px'
|
|
928
742
|
}
|
|
929
743
|
}, {
|
|
930
|
-
children: [loyaltyLoading ? jsxRuntime.jsx(
|
|
744
|
+
children: [loyaltyLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
931
745
|
width: '50px',
|
|
932
746
|
height: '32px',
|
|
933
|
-
borderRadius: '8px'
|
|
747
|
+
borderRadius: '8px',
|
|
748
|
+
backgroundColor: '#efefef'
|
|
934
749
|
}) : selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && !hideLoyaltyChip && jsxRuntime.jsx(LoyaltyChip, {
|
|
935
750
|
icon: LOYALTY_DATA[selectedLoyaltyType].icon,
|
|
936
751
|
borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient,
|
|
937
752
|
backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient,
|
|
938
753
|
chevronFillColor: ((_a = LOYALTY_DATA[selectedLoyaltyType]) === null || _a === void 0 ? void 0 : _a.chevronFillColor) || '#FFF',
|
|
939
754
|
handleChipClick: loyaltyChipClick
|
|
940
|
-
}), superCoinsLoading ? jsxRuntime.jsx(
|
|
755
|
+
}), superCoinsLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
941
756
|
width: '50px',
|
|
942
757
|
height: '32px',
|
|
943
|
-
borderRadius: '8px'
|
|
758
|
+
borderRadius: '8px',
|
|
759
|
+
backgroundColor: '#efefef'
|
|
944
760
|
}) : !hideSupercoinsChip && jsxRuntime.jsx(ExpandableItem, {
|
|
945
761
|
icon: jsxRuntime.jsx(ctDesignIcons.Supercoin, {
|
|
946
762
|
width: 20,
|
|
@@ -948,11 +764,12 @@ var RewardsSection = function () {
|
|
|
948
764
|
}),
|
|
949
765
|
value: superCoinBalance,
|
|
950
766
|
handleChipClick: supercoinsChipClick,
|
|
951
|
-
type: '
|
|
952
|
-
}), walletLoading ? jsxRuntime.jsx(
|
|
767
|
+
type: 'supercoins'
|
|
768
|
+
}), walletLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
953
769
|
width: '50px',
|
|
954
770
|
height: '32px',
|
|
955
|
-
borderRadius: '8px'
|
|
771
|
+
borderRadius: '8px',
|
|
772
|
+
backgroundColor: '#efefef'
|
|
956
773
|
}) : !hideWalletChip && jsxRuntime.jsx(ExpandableItem, {
|
|
957
774
|
icon: jsxRuntime.jsx(ctDesignIcons.Wallet, {
|
|
958
775
|
width: 20,
|
|
@@ -972,60 +789,45 @@ var AccountDropdownContent = function (_a) {
|
|
|
972
789
|
userName = _b.userName,
|
|
973
790
|
userMobileNumber = _b.userMobileNumber,
|
|
974
791
|
countryCode = _b.countryCode,
|
|
975
|
-
userDetailsLoading = _b.userDetailsLoading
|
|
976
|
-
loyaltyType = _b.loyaltyType,
|
|
977
|
-
isUserLoggedIn = _b.isUserLoggedIn,
|
|
978
|
-
ravenEventName = _b.ravenEventName,
|
|
979
|
-
ravenPageName = _b.ravenPageName,
|
|
980
|
-
_c = _b.ravenPayload,
|
|
981
|
-
ravenPayload = _c === void 0 ? {} : _c,
|
|
982
|
-
ravenPushCallback = _b.ravenPushCallback;
|
|
792
|
+
userDetailsLoading = _b.userDetailsLoading;
|
|
983
793
|
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
984
|
-
var
|
|
794
|
+
var _c = react.useMemo(function () {
|
|
795
|
+
var userGreeting = userName && "Hello ".concat(userName, "!");
|
|
796
|
+
var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
|
|
985
797
|
return {
|
|
986
|
-
userGreeting:
|
|
987
|
-
phoneNumber:
|
|
798
|
+
userGreeting: userGreeting,
|
|
799
|
+
phoneNumber: phoneNumber
|
|
988
800
|
};
|
|
989
801
|
}, [userName, userMobileNumber, countryCode]),
|
|
990
|
-
userGreeting =
|
|
991
|
-
phoneNumber =
|
|
992
|
-
var
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
action_name: actionName.toLowerCase().replace(/[\s-]/g, '') + '_account_click',
|
|
996
|
-
action_type: 'click',
|
|
997
|
-
u_utm_source: (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic',
|
|
998
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
802
|
+
userGreeting = _c.userGreeting,
|
|
803
|
+
phoneNumber = _c.phoneNumber;
|
|
804
|
+
var handleRedirectClick = function (redirectLink) {
|
|
805
|
+
return function () {
|
|
806
|
+
window.location.href = redirectLink;
|
|
999
807
|
};
|
|
1000
808
|
};
|
|
1001
|
-
|
|
1002
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(text), ravenPayload, ravenPushCallback, ravenPageName);
|
|
1003
|
-
window.location.href = redirectLink;
|
|
1004
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1005
|
-
react.useCallback(function () {
|
|
1006
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(SIGN_OUT_TEXT), ravenPayload, ravenPushCallback, ravenPageName);
|
|
1007
|
-
handleLogoutClick();
|
|
1008
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, handleLogoutClick]);
|
|
1009
|
-
var positionAccountOptionsDiv = react.useCallback(function () {
|
|
809
|
+
react.useEffect(function () {
|
|
1010
810
|
var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
|
|
1011
811
|
var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
|
|
1012
|
-
|
|
1013
|
-
var headerBtnRight = headerAccBtn.getBoundingClientRect().right;
|
|
1014
|
-
accountOptionsElem
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
812
|
+
var positionAccountOptionsDiv = function () {
|
|
813
|
+
var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
|
|
814
|
+
if (accountOptionsElem && headerBtnRight) {
|
|
815
|
+
accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
|
|
816
|
+
}
|
|
817
|
+
};
|
|
1018
818
|
positionAccountOptionsDiv();
|
|
1019
|
-
}, [
|
|
819
|
+
}, []);
|
|
1020
820
|
var renderUserData = function () {
|
|
1021
821
|
var renderContent = function (loading, content, variant, color) {
|
|
1022
822
|
return jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1023
823
|
variant: variant,
|
|
1024
824
|
color: color
|
|
1025
825
|
}, {
|
|
1026
|
-
children: loading ? jsxRuntime.jsx(
|
|
826
|
+
children: loading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
1027
827
|
height: variant === 'HM3' ? '18px' : '12px',
|
|
1028
|
-
width: variant === 'HM3' ? '140px' : '200px'
|
|
828
|
+
width: variant === 'HM3' ? '140px' : '200px',
|
|
829
|
+
backgroundColor: '#efefef',
|
|
830
|
+
borderRadius: '8px'
|
|
1029
831
|
}) : content
|
|
1030
832
|
}));
|
|
1031
833
|
};
|
|
@@ -1061,7 +863,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
1061
863
|
}, {
|
|
1062
864
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
1063
865
|
padding: '16px',
|
|
1064
|
-
height: '
|
|
866
|
+
height: '72px'
|
|
1065
867
|
}, {
|
|
1066
868
|
children: renderUserData()
|
|
1067
869
|
})), jsxRuntime.jsx(RewardsSection, {}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
@@ -1070,7 +872,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
1070
872
|
padding: '8px',
|
|
1071
873
|
backgroundColor: 'white',
|
|
1072
874
|
rowGap: '8px',
|
|
1073
|
-
|
|
875
|
+
style: {
|
|
1074
876
|
borderBottomLeftRadius: 12,
|
|
1075
877
|
borderBottomRightRadius: 12
|
|
1076
878
|
}
|
|
@@ -1084,14 +886,12 @@ var AccountDropdownContent = function (_a) {
|
|
|
1084
886
|
padding: '8px',
|
|
1085
887
|
borderRadius: '8px',
|
|
1086
888
|
cursor: 'pointer',
|
|
1087
|
-
onClick:
|
|
1088
|
-
return handleAccountOptionsClick(text, redirectionLink);
|
|
1089
|
-
}
|
|
889
|
+
onClick: handleRedirectClick(redirectionLink)
|
|
1090
890
|
}, {
|
|
1091
891
|
children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1092
892
|
display: 'flex',
|
|
1093
893
|
cursor: 'pointer',
|
|
1094
|
-
|
|
894
|
+
style: {
|
|
1095
895
|
columnGap: '8px'
|
|
1096
896
|
}
|
|
1097
897
|
}, {
|
|
@@ -1108,7 +908,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
1108
908
|
}))
|
|
1109
909
|
}), "account-option-".concat(text));
|
|
1110
910
|
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1111
|
-
|
|
911
|
+
style: {
|
|
1112
912
|
borderBottom: '1px dashed #E6E6E6'
|
|
1113
913
|
}
|
|
1114
914
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
@@ -1139,49 +939,29 @@ var AccountDropdownContent = function (_a) {
|
|
|
1139
939
|
};
|
|
1140
940
|
|
|
1141
941
|
var UserAccount = function () {
|
|
1142
|
-
var
|
|
1143
|
-
|
|
1144
|
-
ravenEventName = _a.ravenEventName,
|
|
1145
|
-
_b = _a.ravenPayload,
|
|
1146
|
-
ravenPayload = _b === void 0 ? {} : _b,
|
|
1147
|
-
ravenPushCallback = _a.ravenPushCallback,
|
|
1148
|
-
isUserLoggedIn = _a.isUserLoggedIn,
|
|
1149
|
-
loyaltyType = _a.loyaltyType,
|
|
1150
|
-
ravenPageName = _a.ravenPageName;
|
|
1151
|
-
var _c = useHoverDropdown({
|
|
942
|
+
var isNovacThemeEnabled = useHeaderContext().isNovacThemeEnabled;
|
|
943
|
+
var _a = useHoverDropdown({
|
|
1152
944
|
openDelay: 0
|
|
1153
945
|
}),
|
|
1154
|
-
isDropdownVisible =
|
|
1155
|
-
handleOnMouseEnter =
|
|
1156
|
-
handleOnMouseLeave =
|
|
1157
|
-
handleDropdownMouseEnter =
|
|
1158
|
-
handleDropdownMouseLeave =
|
|
1159
|
-
var
|
|
1160
|
-
scrolled =
|
|
1161
|
-
setScrolled =
|
|
946
|
+
isDropdownVisible = _a.isDropdownVisible,
|
|
947
|
+
handleOnMouseEnter = _a.handleOnMouseEnter,
|
|
948
|
+
handleOnMouseLeave = _a.handleOnMouseLeave,
|
|
949
|
+
handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
|
|
950
|
+
handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
|
|
951
|
+
var _b = react.useState(false),
|
|
952
|
+
scrolled = _b[0],
|
|
953
|
+
setScrolled = _b[1];
|
|
1162
954
|
react.useEffect(function () {
|
|
1163
955
|
var handleScroll = function () {
|
|
1164
|
-
setScrolled(window.scrollY >=
|
|
956
|
+
setScrolled(window.scrollY >= 100);
|
|
1165
957
|
};
|
|
1166
958
|
window.addEventListener('scroll', handleScroll);
|
|
1167
959
|
return function () {
|
|
1168
960
|
return window.removeEventListener('scroll', handleScroll);
|
|
1169
961
|
};
|
|
1170
962
|
}, []);
|
|
1171
|
-
var
|
|
1172
|
-
var hoverColor =
|
|
1173
|
-
typographyColor = theme.typographyColor;
|
|
1174
|
-
var triggerRavenEventOnHover = react.useCallback(function () {
|
|
1175
|
-
var _a;
|
|
1176
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
1177
|
-
var defaultPayload = {
|
|
1178
|
-
action_name: "".concat(MY_ACCOUNT_TEXT.toLowerCase().replace(/[\s-]/g, ''), "_header_hover"),
|
|
1179
|
-
action_type: 'hover',
|
|
1180
|
-
u_utm_source: utmSource,
|
|
1181
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
1182
|
-
};
|
|
1183
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1184
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
|
|
963
|
+
var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
|
|
964
|
+
var hoverColor = effectiveNovacThemeEnabled ? '#FFB8A5' : '#FF4F17';
|
|
1185
965
|
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
1186
966
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1187
967
|
display: 'flex',
|
|
@@ -1190,19 +970,18 @@ var UserAccount = function () {
|
|
|
1190
970
|
borderRadius: '12px',
|
|
1191
971
|
height: '100%',
|
|
1192
972
|
cursor: 'pointer',
|
|
1193
|
-
|
|
973
|
+
style: {
|
|
1194
974
|
columnGap: 8,
|
|
1195
975
|
height: 64
|
|
1196
976
|
},
|
|
1197
977
|
onMouseEnter: function () {
|
|
1198
|
-
handleOnMouseEnter(0);
|
|
1199
|
-
triggerRavenEventOnHover();
|
|
978
|
+
return handleOnMouseEnter(0);
|
|
1200
979
|
},
|
|
1201
980
|
onMouseLeave: handleOnMouseLeave,
|
|
1202
981
|
id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
|
|
1203
982
|
}, {
|
|
1204
983
|
children: [jsxRuntime.jsx(ctDesignIcons.MyAccount, {
|
|
1205
|
-
color: isDropdownVisible ? hoverColor :
|
|
984
|
+
color: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1206
985
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1207
986
|
display: 'flex',
|
|
1208
987
|
flexDirection: 'row',
|
|
@@ -1213,13 +992,13 @@ var UserAccount = function () {
|
|
|
1213
992
|
css: {
|
|
1214
993
|
cursor: 'pointer'
|
|
1215
994
|
},
|
|
1216
|
-
colorCode: isDropdownVisible ? hoverColor :
|
|
995
|
+
colorCode: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1217
996
|
}, {
|
|
1218
|
-
children:
|
|
997
|
+
children: "My Account"
|
|
1219
998
|
})), jsxRuntime.jsx(ctDesignIcons.ChevronDown, {
|
|
1220
999
|
width: 20,
|
|
1221
1000
|
height: 20,
|
|
1222
|
-
fill: isDropdownVisible ? hoverColor :
|
|
1001
|
+
fill: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1223
1002
|
})]
|
|
1224
1003
|
}))]
|
|
1225
1004
|
})), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
@@ -1244,74 +1023,42 @@ var Header = function (props) {
|
|
|
1244
1023
|
}));
|
|
1245
1024
|
};
|
|
1246
1025
|
var HeaderContent = function () {
|
|
1247
|
-
var _a
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
scrolled = _f[0],
|
|
1263
|
-
setScrolled = _f[1];
|
|
1026
|
+
var _a = useHeaderContext(),
|
|
1027
|
+
onLoginButtonClick = _a.onLoginButtonClick,
|
|
1028
|
+
_b = _a.showAllLobs,
|
|
1029
|
+
showAllLobs = _b === void 0 ? false : _b,
|
|
1030
|
+
isUserLoggedIn = _a.isUserLoggedIn;
|
|
1031
|
+
_a.loyaltyType;
|
|
1032
|
+
var _c = _a.isNovacThemeEnabled,
|
|
1033
|
+
isNovacThemeEnabled = _c === void 0 ? false : _c;
|
|
1034
|
+
_a.ravenPayload;
|
|
1035
|
+
_a.ravenPushCallback;
|
|
1036
|
+
_a.ravenPageName;
|
|
1037
|
+
_a.ravenEventName;
|
|
1038
|
+
var _e = react.useState(false),
|
|
1039
|
+
scrolled = _e[0],
|
|
1040
|
+
setScrolled = _e[1];
|
|
1264
1041
|
react.useEffect(function () {
|
|
1265
1042
|
var handleScroll = function () {
|
|
1266
|
-
setScrolled(window.scrollY >=
|
|
1043
|
+
setScrolled(window.scrollY >= 100);
|
|
1267
1044
|
};
|
|
1268
1045
|
window.addEventListener('scroll', handleScroll);
|
|
1269
1046
|
return function () {
|
|
1270
1047
|
return window.removeEventListener('scroll', handleScroll);
|
|
1271
1048
|
};
|
|
1272
1049
|
}, []);
|
|
1273
|
-
var
|
|
1274
|
-
var headerBackground =
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
fkcompanyColor = theme.fkcompanyColor,
|
|
1278
|
-
typographyColor = theme.typographyColor;
|
|
1279
|
-
var _g = useHoverDropdown({
|
|
1050
|
+
var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
|
|
1051
|
+
var headerBackground = effectiveNovacThemeEnabled ? 'transparent' : '#F7FAFF';
|
|
1052
|
+
var hoverColor = effectiveNovacThemeEnabled ? '#FFB8A5' : '#FF4F17';
|
|
1053
|
+
var _f = useHoverDropdown({
|
|
1280
1054
|
openDelay: 0
|
|
1281
1055
|
}),
|
|
1282
|
-
isDropdownVisible =
|
|
1283
|
-
hoveredElemIndex =
|
|
1284
|
-
handleOnMouseEnter =
|
|
1285
|
-
handleOnMouseLeave =
|
|
1286
|
-
handleDropdownMouseEnter =
|
|
1287
|
-
handleDropdownMouseLeave =
|
|
1288
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
1289
|
-
var createPayload = react.useCallback(function (actionName, actionType) {
|
|
1290
|
-
return {
|
|
1291
|
-
action_name: actionName,
|
|
1292
|
-
action_type: actionType,
|
|
1293
|
-
u_utm_source: utmSource,
|
|
1294
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
1295
|
-
};
|
|
1296
|
-
}, [utmSource, loyaltyType]);
|
|
1297
|
-
var handleNavbarOptionsClick = react.useCallback(function (option) {
|
|
1298
|
-
if (option.isClickable && option.link) {
|
|
1299
|
-
var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_click");
|
|
1300
|
-
var payload = createPayload(actionName, 'click');
|
|
1301
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1302
|
-
window.location.href = option.link;
|
|
1303
|
-
}
|
|
1304
|
-
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1305
|
-
var handleHomeClick = react.useCallback(function () {
|
|
1306
|
-
var payload = createPayload('home_header_click', 'click');
|
|
1307
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1308
|
-
window.location.href = '/';
|
|
1309
|
-
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1310
|
-
var triggerRavenEventOnHover = react.useCallback(function (option) {
|
|
1311
|
-
var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_hover");
|
|
1312
|
-
var payload = createPayload(actionName, 'hover');
|
|
1313
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1314
|
-
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1056
|
+
isDropdownVisible = _f.isDropdownVisible,
|
|
1057
|
+
hoveredElemIndex = _f.hoveredElemIndex,
|
|
1058
|
+
handleOnMouseEnter = _f.handleOnMouseEnter,
|
|
1059
|
+
handleOnMouseLeave = _f.handleOnMouseLeave,
|
|
1060
|
+
handleDropdownMouseEnter = _f.handleDropdownMouseEnter,
|
|
1061
|
+
handleDropdownMouseLeave = _f.handleDropdownMouseLeave;
|
|
1315
1062
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1316
1063
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
1317
1064
|
display: 'flex',
|
|
@@ -1326,7 +1073,7 @@ var HeaderContent = function () {
|
|
|
1326
1073
|
css: {
|
|
1327
1074
|
gap: '24px',
|
|
1328
1075
|
flexShrink: 0,
|
|
1329
|
-
borderBottom:
|
|
1076
|
+
borderBottom: effectiveNovacThemeEnabled ? '' : '1px solid #E6E6E6',
|
|
1330
1077
|
transition: 'background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out'
|
|
1331
1078
|
}
|
|
1332
1079
|
}, {
|
|
@@ -1336,7 +1083,7 @@ var HeaderContent = function () {
|
|
|
1336
1083
|
justifyContent: 'space-between',
|
|
1337
1084
|
padding: '0 28px',
|
|
1338
1085
|
flex: 1,
|
|
1339
|
-
|
|
1086
|
+
style: {
|
|
1340
1087
|
gap: '24px',
|
|
1341
1088
|
maxWidth: 1440
|
|
1342
1089
|
}
|
|
@@ -1347,10 +1094,13 @@ var HeaderContent = function () {
|
|
|
1347
1094
|
alignItems: 'center',
|
|
1348
1095
|
justifyContent: 'center',
|
|
1349
1096
|
cursor: 'pointer',
|
|
1350
|
-
|
|
1097
|
+
paddingLeft: '16px',
|
|
1098
|
+
onClick: function () {
|
|
1099
|
+
window.location.href = '/';
|
|
1100
|
+
}
|
|
1351
1101
|
}, {
|
|
1352
1102
|
children: [jsxRuntime.jsx(ctDesignIcons.CTLogo, {
|
|
1353
|
-
fillColor:
|
|
1103
|
+
fillColor: effectiveNovacThemeEnabled ? '#FFF' : '#FF4F17'
|
|
1354
1104
|
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1355
1105
|
css: {
|
|
1356
1106
|
width: 12,
|
|
@@ -1360,7 +1110,7 @@ var HeaderContent = function () {
|
|
|
1360
1110
|
borderBottom: '1px solid #e0e0e0'
|
|
1361
1111
|
}
|
|
1362
1112
|
}), jsxRuntime.jsx(ctDesignIcons.Fkcompany, {
|
|
1363
|
-
color:
|
|
1113
|
+
color: effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1364
1114
|
})]
|
|
1365
1115
|
})), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1366
1116
|
display: 'flex',
|
|
@@ -1377,18 +1127,11 @@ var HeaderContent = function () {
|
|
|
1377
1127
|
columnGap: '4px'
|
|
1378
1128
|
}, {
|
|
1379
1129
|
children: NAVBAR_OPTIONS.map(function (option, index) {
|
|
1380
|
-
var text = option.text,
|
|
1381
|
-
LeftIcon = option.lefticon,
|
|
1382
|
-
RightIcon = option.rightIcon,
|
|
1383
|
-
isHoverable = option.isHoverable;
|
|
1384
1130
|
var isHovered = hoveredElemIndex === index;
|
|
1385
1131
|
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
1386
1132
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1387
1133
|
onMouseEnter: function () {
|
|
1388
|
-
handleOnMouseEnter(index);
|
|
1389
|
-
if (option.isHoverable) {
|
|
1390
|
-
triggerRavenEventOnHover(option);
|
|
1391
|
-
}
|
|
1134
|
+
return handleOnMouseEnter(index);
|
|
1392
1135
|
},
|
|
1393
1136
|
onMouseLeave: handleOnMouseLeave,
|
|
1394
1137
|
display: 'flex',
|
|
@@ -1400,11 +1143,13 @@ var HeaderContent = function () {
|
|
|
1400
1143
|
columnGap: 8,
|
|
1401
1144
|
height: '64px',
|
|
1402
1145
|
onClick: function () {
|
|
1403
|
-
|
|
1146
|
+
if (option.link && option.isClickable) {
|
|
1147
|
+
window.location.href = option.link;
|
|
1148
|
+
}
|
|
1404
1149
|
}
|
|
1405
1150
|
}, {
|
|
1406
|
-
children: [jsxRuntime.jsx(
|
|
1407
|
-
color: isHovered ? hoverColor :
|
|
1151
|
+
children: [jsxRuntime.jsx(option.lefticon, {
|
|
1152
|
+
color: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1408
1153
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1409
1154
|
display: 'flex',
|
|
1410
1155
|
flexDirection: 'row',
|
|
@@ -1412,31 +1157,31 @@ var HeaderContent = function () {
|
|
|
1412
1157
|
}, {
|
|
1413
1158
|
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1414
1159
|
variant: 'B2',
|
|
1415
|
-
colorCode: isHovered ? hoverColor :
|
|
1160
|
+
colorCode: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A',
|
|
1416
1161
|
isClickable: true
|
|
1417
1162
|
}, {
|
|
1418
|
-
children: text
|
|
1419
|
-
})),
|
|
1163
|
+
children: option.text
|
|
1164
|
+
})), option.rightIcon && jsxRuntime.jsx(option.rightIcon, {
|
|
1420
1165
|
width: 20,
|
|
1421
1166
|
height: 20,
|
|
1422
|
-
fill: isHovered ? hoverColor :
|
|
1167
|
+
fill: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1423
1168
|
})]
|
|
1424
1169
|
}))]
|
|
1425
1170
|
}), "nav-option-".concat(index)), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
1426
|
-
show: hoveredElemIndex === index && isHoverable && isDropdownVisible,
|
|
1171
|
+
show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible,
|
|
1427
1172
|
marginTop: '64px',
|
|
1428
1173
|
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
1429
1174
|
handleDropdownMouseLeave: handleDropdownMouseLeave,
|
|
1430
1175
|
onMaskClick: handleDropdownMouseLeave
|
|
1431
1176
|
}, {
|
|
1432
1177
|
children: jsxRuntime.jsx(BusinessDropdownContent, {
|
|
1433
|
-
isOpen: hoveredElemIndex === index && isHoverable && isDropdownVisible
|
|
1178
|
+
isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible
|
|
1434
1179
|
})
|
|
1435
1180
|
}))]
|
|
1436
1181
|
});
|
|
1437
1182
|
})
|
|
1438
1183
|
})), isUserLoggedIn && jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1439
|
-
|
|
1184
|
+
style: {
|
|
1440
1185
|
width: 12,
|
|
1441
1186
|
margin: '0 -18px',
|
|
1442
1187
|
transform: 'rotate(90deg)',
|
|
@@ -1450,21 +1195,21 @@ var HeaderContent = function () {
|
|
|
1450
1195
|
}, {
|
|
1451
1196
|
children: jsxRuntime.jsx(UserAccount, {})
|
|
1452
1197
|
})) : jsxRuntime.jsx(ctDesignButton.Button, tslib.__assign({
|
|
1453
|
-
className: "".concat(
|
|
1198
|
+
className: "fw-400 fs-14 ".concat(effectiveNovacThemeEnabled ? 'novac-login-button' : 'login-button'),
|
|
1454
1199
|
onClick: onLoginButtonClick,
|
|
1455
|
-
|
|
1200
|
+
style: {
|
|
1456
1201
|
width: 153,
|
|
1457
1202
|
height: 40,
|
|
1458
|
-
border:
|
|
1203
|
+
border: effectiveNovacThemeEnabled ? '1px solid #FFF' : '1px solid #1A1A1A'
|
|
1459
1204
|
},
|
|
1460
1205
|
loading: false
|
|
1461
1206
|
}, {
|
|
1462
1207
|
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1463
1208
|
componentNode: 'span',
|
|
1464
1209
|
variant: 'L2',
|
|
1465
|
-
color:
|
|
1210
|
+
color: effectiveNovacThemeEnabled ? 'neutral' : 'primary'
|
|
1466
1211
|
}, {
|
|
1467
|
-
children:
|
|
1212
|
+
children: "Login"
|
|
1468
1213
|
}))
|
|
1469
1214
|
}))
|
|
1470
1215
|
})]
|