@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-v0.7.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 -450
- package/dist/ct-design-header.cjs.js.map +1 -1
- package/dist/ct-design-header.esm.js +197 -451
- package/dist/ct-design-header.esm.js.map +1 -1
- package/dist/ct-design-header.umd.js +200 -453
- 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,53 +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
|
-
padding: '8px 16px 8px 8px',
|
|
181
|
-
transition: 'background 0.2s ease'
|
|
182
|
-
}
|
|
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
|
|
183
157
|
}, {
|
|
184
|
-
children:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
width: 32,
|
|
188
|
-
height: 32
|
|
189
|
-
}), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
190
|
-
variant: isSelected ? ctDesignTypography.TypographyVariant.HM3 : ctDesignTypography.TypographyVariant.B1,
|
|
191
|
-
isClickable: true
|
|
192
|
-
}, {
|
|
193
|
-
children: title
|
|
194
|
-
}))]
|
|
195
|
-
}), index)
|
|
196
|
-
}));
|
|
158
|
+
children: item.title
|
|
159
|
+
}))]
|
|
160
|
+
}), index);
|
|
197
161
|
})
|
|
198
162
|
}));
|
|
199
163
|
};
|
|
@@ -392,85 +356,11 @@ var useDropdownAnimation = function (isOpen) {
|
|
|
392
356
|
};
|
|
393
357
|
};
|
|
394
358
|
|
|
395
|
-
var stringifyPayload = function (payload) {
|
|
396
|
-
var keys = Object.keys(payload);
|
|
397
|
-
var numericValues = [];
|
|
398
|
-
keys.forEach(function (key) {
|
|
399
|
-
if (numericValues.includes(key)) {
|
|
400
|
-
payload[key] = Number(payload[key]);
|
|
401
|
-
} else {
|
|
402
|
-
payload[key] = '' + payload[key];
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
return payload;
|
|
406
|
-
};
|
|
407
|
-
var isServer = function () {
|
|
408
|
-
return typeof window === 'undefined' || !window;
|
|
409
|
-
};
|
|
410
|
-
var getQueryParam = function (queryParam) {
|
|
411
|
-
if (isServer()) {
|
|
412
|
-
return '';
|
|
413
|
-
}
|
|
414
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
415
|
-
return urlParams.get(queryParam);
|
|
416
|
-
};
|
|
417
|
-
var ravenLoyaltyTypes = function (loyaltyType) {
|
|
418
|
-
switch (loyaltyType) {
|
|
419
|
-
case 'FkVip':
|
|
420
|
-
return 'fk_vip';
|
|
421
|
-
case 'FkPremium':
|
|
422
|
-
return 'fk_plus_premium';
|
|
423
|
-
case 'InsiderIcon':
|
|
424
|
-
return 'myntra_insidericon';
|
|
425
|
-
case 'InsiderElite':
|
|
426
|
-
return 'myntra_insiderelite';
|
|
427
|
-
default:
|
|
428
|
-
return '';
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
var ravenSDKTrigger = function (isUserLoggedIn, eventName, ravenPayload, customRavenPayload, ravenPushCallback, pageName) {
|
|
432
|
-
var _a;
|
|
433
|
-
if (typeof ravenPushCallback !== 'function') {
|
|
434
|
-
console.error('ravenPushCallback is not provided or is not a function');
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
var commonPayload = {
|
|
438
|
-
page_name: pageName,
|
|
439
|
-
platform: RAVEN_PLATFORMS.DESKTOP,
|
|
440
|
-
login_status: isUserLoggedIn ? 'yes' : 'no',
|
|
441
|
-
domain: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host
|
|
442
|
-
};
|
|
443
|
-
var newRavenPayload = stringifyPayload(ravenPayload);
|
|
444
|
-
var parsedCustomRavenPayload = stringifyPayload(customRavenPayload);
|
|
445
|
-
var finalPayload = tslib.__assign(tslib.__assign(tslib.__assign({}, commonPayload), newRavenPayload), parsedCustomRavenPayload);
|
|
446
|
-
try {
|
|
447
|
-
if (ravenPushCallback.length === 1) {
|
|
448
|
-
ravenPushCallback({
|
|
449
|
-
eventName: eventName,
|
|
450
|
-
eventData: finalPayload
|
|
451
|
-
});
|
|
452
|
-
} else {
|
|
453
|
-
ravenPushCallback(eventName, finalPayload);
|
|
454
|
-
}
|
|
455
|
-
} catch (err) {
|
|
456
|
-
console.error(err);
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
|
|
461
359
|
var BusinessDropdownContent = function (_a) {
|
|
462
360
|
var isOpen = _a.isOpen;
|
|
463
|
-
var _b =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
ravenPageName = _b.ravenPageName,
|
|
467
|
-
ravenEventName = _b.ravenEventName,
|
|
468
|
-
loyaltyType = _b.loyaltyType,
|
|
469
|
-
_c = _b.ravenPayload,
|
|
470
|
-
ravenPayload = _c === void 0 ? {} : _c;
|
|
471
|
-
var _d = react.useState(0),
|
|
472
|
-
leftPosition = _d[0],
|
|
473
|
-
setLeftPosition = _d[1];
|
|
361
|
+
var _b = react.useState(0),
|
|
362
|
+
leftPosition = _b[0],
|
|
363
|
+
setLeftPosition = _b[1];
|
|
474
364
|
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
475
365
|
react.useEffect(function () {
|
|
476
366
|
var updatePosition = function () {
|
|
@@ -489,21 +379,6 @@ var BusinessDropdownContent = function (_a) {
|
|
|
489
379
|
return window.removeEventListener('resize', updatePosition);
|
|
490
380
|
};
|
|
491
381
|
}, [containerRef, leftPosition]);
|
|
492
|
-
var handleBusinessDropdownClick = react.useCallback(function (link, title, ravenActionName) {
|
|
493
|
-
var _a;
|
|
494
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
495
|
-
var actionName = ravenActionName ? "".concat(ravenActionName, "_business_click") : title ? "".concat(title.toLowerCase(), "_business_click") : '';
|
|
496
|
-
var defaultPayload = {
|
|
497
|
-
action_name: actionName,
|
|
498
|
-
action_type: 'click',
|
|
499
|
-
u_utm_source: utmSource,
|
|
500
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
501
|
-
};
|
|
502
|
-
if (link) {
|
|
503
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
504
|
-
window.location.href = link;
|
|
505
|
-
}
|
|
506
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
|
|
507
382
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
508
383
|
ref: containerRef,
|
|
509
384
|
backgroundColor: '#fff',
|
|
@@ -524,7 +399,10 @@ var BusinessDropdownContent = function (_a) {
|
|
|
524
399
|
backgroundColor: '#FFF1EC'
|
|
525
400
|
}, {
|
|
526
401
|
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
527
|
-
variant: 'HM2'
|
|
402
|
+
variant: 'HM2',
|
|
403
|
+
css: {
|
|
404
|
+
lineHeight: '24px'
|
|
405
|
+
}
|
|
528
406
|
}, {
|
|
529
407
|
children: BUSINESS_DROPDOWN_HEADING
|
|
530
408
|
}))
|
|
@@ -538,46 +416,32 @@ var BusinessDropdownContent = function (_a) {
|
|
|
538
416
|
children: bdConfig.map(function (_a) {
|
|
539
417
|
var title = _a.title,
|
|
540
418
|
subtitle = _a.subtitle,
|
|
541
|
-
details = _a.details
|
|
542
|
-
link = _a.link,
|
|
543
|
-
ravenActionName = _a.ravenActionName;
|
|
419
|
+
details = _a.details;
|
|
544
420
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
545
421
|
cursor: 'pointer',
|
|
546
|
-
display: 'flex',
|
|
547
|
-
flexDirection: 'column',
|
|
548
422
|
width: '200px',
|
|
549
|
-
|
|
550
|
-
className: 'bd-hover-container',
|
|
551
|
-
onClick: function () {
|
|
552
|
-
return handleBusinessDropdownClick(link, title, ravenActionName);
|
|
553
|
-
}
|
|
423
|
+
className: 'bd-hover-container'
|
|
554
424
|
}, {
|
|
555
425
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
556
426
|
display: 'flex',
|
|
557
|
-
flexDirection: '
|
|
558
|
-
|
|
427
|
+
flexDirection: 'row',
|
|
428
|
+
alignItems: 'center',
|
|
429
|
+
columnGap: '8px'
|
|
559
430
|
}, {
|
|
560
|
-
children: [jsxRuntime.
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
alignItems: 'center',
|
|
564
|
-
columnGap: '8px'
|
|
431
|
+
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
432
|
+
variant: 'HM2',
|
|
433
|
+
className: 'color-orange-on-hover'
|
|
565
434
|
}, {
|
|
566
|
-
children:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
opacity: 0.75
|
|
577
|
-
}
|
|
578
|
-
}, {
|
|
579
|
-
children: subtitle
|
|
580
|
-
}))]
|
|
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
|
|
581
445
|
})), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
582
446
|
variant: 'P3',
|
|
583
447
|
color: 'subheading',
|
|
@@ -655,7 +519,6 @@ var ACCOUNT_OPTIONS_POPUP_CONFIG = [{
|
|
|
655
519
|
redirectionLink: 'accounts/personal-data-dashboard'
|
|
656
520
|
}];
|
|
657
521
|
var SIGN_OUT_TEXT = 'Logout';
|
|
658
|
-
var MY_ACCOUNT_TEXT = 'My Account';
|
|
659
522
|
var LOGGEDIN_USER_TEXT = 'You are logged in with';
|
|
660
523
|
var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
|
|
661
524
|
var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
|
|
@@ -667,33 +530,13 @@ var LoyaltyChip = function (_a) {
|
|
|
667
530
|
backgroundGradient = _a.backgroundGradient,
|
|
668
531
|
handleChipClick = _a.handleChipClick,
|
|
669
532
|
chevronFillColor = _a.chevronFillColor;
|
|
670
|
-
var _b =
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
ravenEventName = _b.ravenEventName;
|
|
678
|
-
var _d = react.useState(false),
|
|
679
|
-
isHovered = _d[0],
|
|
680
|
-
setIsHovered = _d[1];
|
|
681
|
-
var handleClick = react.useCallback(function () {
|
|
682
|
-
var _a;
|
|
683
|
-
if (handleChipClick) {
|
|
684
|
-
handleChipClick();
|
|
685
|
-
} else {
|
|
686
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
687
|
-
var defaultPayload = {
|
|
688
|
-
action_name: "loyalty_account_click",
|
|
689
|
-
action_type: 'click',
|
|
690
|
-
u_utm_source: utmSource,
|
|
691
|
-
loyaltyType: ravenLoyaltyTypes(loyaltyType)
|
|
692
|
-
};
|
|
693
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
694
|
-
window.location.href = '/all-offers/loyalty-october';
|
|
695
|
-
}
|
|
696
|
-
}, [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
|
+
};
|
|
697
540
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
698
541
|
display: 'flex',
|
|
699
542
|
position: 'relative',
|
|
@@ -718,7 +561,7 @@ var LoyaltyChip = function (_a) {
|
|
|
718
561
|
onClick: handleClick
|
|
719
562
|
}, {
|
|
720
563
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
721
|
-
|
|
564
|
+
style: {
|
|
722
565
|
content: '""',
|
|
723
566
|
position: 'absolute',
|
|
724
567
|
inset: 0,
|
|
@@ -727,7 +570,7 @@ var LoyaltyChip = function (_a) {
|
|
|
727
570
|
zIndex: -2
|
|
728
571
|
}
|
|
729
572
|
}), jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
730
|
-
|
|
573
|
+
style: {
|
|
731
574
|
content: '""',
|
|
732
575
|
position: 'absolute',
|
|
733
576
|
inset: 0,
|
|
@@ -748,7 +591,7 @@ var LoyaltyChip = function (_a) {
|
|
|
748
591
|
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
749
592
|
display: 'flex',
|
|
750
593
|
alignItems: 'center',
|
|
751
|
-
|
|
594
|
+
style: {
|
|
752
595
|
overflow: 'hidden',
|
|
753
596
|
maxWidth: isHovered ? 16 : 0,
|
|
754
597
|
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
@@ -813,46 +656,24 @@ var ExpandableItem = function (_a) {
|
|
|
813
656
|
handleChipClick = _a.handleChipClick,
|
|
814
657
|
value = _a.value,
|
|
815
658
|
type = _a.type;
|
|
816
|
-
var _b =
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
var _d = react.useState(false),
|
|
825
|
-
isHovered = _d[0],
|
|
826
|
-
setIsHovered = _d[1];
|
|
827
|
-
var handleDefaultClick = react.useCallback(function () {
|
|
828
|
-
var _a;
|
|
829
|
-
if (handleChipClick) {
|
|
830
|
-
handleChipClick();
|
|
831
|
-
} else {
|
|
832
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
833
|
-
var defaultPayload = {
|
|
834
|
-
action_name: "".concat(type, "_account_click"),
|
|
835
|
-
action_type: 'click',
|
|
836
|
-
u_utm_source: utmSource,
|
|
837
|
-
loyaltyType: ravenLoyaltyTypes(loyaltyType)
|
|
838
|
-
};
|
|
839
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
840
|
-
var redirectUrls = {
|
|
841
|
-
supercoin: '/all-offers/supercoins/',
|
|
842
|
-
wallet: '/accounts/wallet'
|
|
843
|
-
};
|
|
844
|
-
if (redirectUrls[type]) {
|
|
845
|
-
window.location.href = redirectUrls[type];
|
|
846
|
-
}
|
|
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';
|
|
847
667
|
}
|
|
848
|
-
|
|
668
|
+
handleChipClick && handleChipClick();
|
|
669
|
+
};
|
|
849
670
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
850
671
|
display: 'flex',
|
|
851
672
|
alignItems: 'center',
|
|
852
673
|
justifyContent: 'center',
|
|
853
674
|
borderRadius: '8px',
|
|
854
675
|
cursor: 'pointer',
|
|
855
|
-
|
|
676
|
+
style: {
|
|
856
677
|
height: 32,
|
|
857
678
|
paddingLeft: 8,
|
|
858
679
|
paddingRight: isHovered ? 4 : 8,
|
|
@@ -883,7 +704,7 @@ var ExpandableItem = function (_a) {
|
|
|
883
704
|
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
884
705
|
display: 'flex',
|
|
885
706
|
alignItems: 'center',
|
|
886
|
-
|
|
707
|
+
style: {
|
|
887
708
|
overflow: 'hidden',
|
|
888
709
|
maxWidth: isHovered ? 16 : 0,
|
|
889
710
|
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
@@ -911,12 +732,6 @@ var RewardsSection = function () {
|
|
|
911
732
|
hideWalletChip = _b.hideWalletChip,
|
|
912
733
|
hideSupercoinsChip = _b.hideSupercoinsChip,
|
|
913
734
|
hideLoyaltyChip = _b.hideLoyaltyChip;
|
|
914
|
-
var shouldShowLoyalty = loyaltyLoading || selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && !hideLoyaltyChip;
|
|
915
|
-
var shouldShowSupercoin = superCoinsLoading || !hideSupercoinsChip;
|
|
916
|
-
var shouldShowWallet = walletLoading || !hideWalletChip;
|
|
917
|
-
if (!shouldShowLoyalty && !shouldShowSupercoin && !shouldShowWallet) {
|
|
918
|
-
return null;
|
|
919
|
-
}
|
|
920
735
|
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
921
736
|
display: 'flex',
|
|
922
737
|
padding: '0 16px 16px 16px',
|
|
@@ -926,20 +741,22 @@ var RewardsSection = function () {
|
|
|
926
741
|
gap: '4px'
|
|
927
742
|
}
|
|
928
743
|
}, {
|
|
929
|
-
children: [loyaltyLoading ? jsxRuntime.jsx(
|
|
744
|
+
children: [loyaltyLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
930
745
|
width: '50px',
|
|
931
746
|
height: '32px',
|
|
932
|
-
borderRadius: '8px'
|
|
747
|
+
borderRadius: '8px',
|
|
748
|
+
backgroundColor: '#efefef'
|
|
933
749
|
}) : selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && !hideLoyaltyChip && jsxRuntime.jsx(LoyaltyChip, {
|
|
934
750
|
icon: LOYALTY_DATA[selectedLoyaltyType].icon,
|
|
935
751
|
borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient,
|
|
936
752
|
backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient,
|
|
937
753
|
chevronFillColor: ((_a = LOYALTY_DATA[selectedLoyaltyType]) === null || _a === void 0 ? void 0 : _a.chevronFillColor) || '#FFF',
|
|
938
754
|
handleChipClick: loyaltyChipClick
|
|
939
|
-
}), superCoinsLoading ? jsxRuntime.jsx(
|
|
755
|
+
}), superCoinsLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
940
756
|
width: '50px',
|
|
941
757
|
height: '32px',
|
|
942
|
-
borderRadius: '8px'
|
|
758
|
+
borderRadius: '8px',
|
|
759
|
+
backgroundColor: '#efefef'
|
|
943
760
|
}) : !hideSupercoinsChip && jsxRuntime.jsx(ExpandableItem, {
|
|
944
761
|
icon: jsxRuntime.jsx(ctDesignIcons.Supercoin, {
|
|
945
762
|
width: 20,
|
|
@@ -947,11 +764,12 @@ var RewardsSection = function () {
|
|
|
947
764
|
}),
|
|
948
765
|
value: superCoinBalance,
|
|
949
766
|
handleChipClick: supercoinsChipClick,
|
|
950
|
-
type: '
|
|
951
|
-
}), walletLoading ? jsxRuntime.jsx(
|
|
767
|
+
type: 'supercoins'
|
|
768
|
+
}), walletLoading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
952
769
|
width: '50px',
|
|
953
770
|
height: '32px',
|
|
954
|
-
borderRadius: '8px'
|
|
771
|
+
borderRadius: '8px',
|
|
772
|
+
backgroundColor: '#efefef'
|
|
955
773
|
}) : !hideWalletChip && jsxRuntime.jsx(ExpandableItem, {
|
|
956
774
|
icon: jsxRuntime.jsx(ctDesignIcons.Wallet, {
|
|
957
775
|
width: 20,
|
|
@@ -971,60 +789,45 @@ var AccountDropdownContent = function (_a) {
|
|
|
971
789
|
userName = _b.userName,
|
|
972
790
|
userMobileNumber = _b.userMobileNumber,
|
|
973
791
|
countryCode = _b.countryCode,
|
|
974
|
-
userDetailsLoading = _b.userDetailsLoading
|
|
975
|
-
loyaltyType = _b.loyaltyType,
|
|
976
|
-
isUserLoggedIn = _b.isUserLoggedIn,
|
|
977
|
-
ravenEventName = _b.ravenEventName,
|
|
978
|
-
ravenPageName = _b.ravenPageName,
|
|
979
|
-
_c = _b.ravenPayload,
|
|
980
|
-
ravenPayload = _c === void 0 ? {} : _c,
|
|
981
|
-
ravenPushCallback = _b.ravenPushCallback;
|
|
792
|
+
userDetailsLoading = _b.userDetailsLoading;
|
|
982
793
|
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
983
|
-
var
|
|
794
|
+
var _c = react.useMemo(function () {
|
|
795
|
+
var userGreeting = userName && "Hello ".concat(userName, "!");
|
|
796
|
+
var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
|
|
984
797
|
return {
|
|
985
|
-
userGreeting:
|
|
986
|
-
phoneNumber:
|
|
798
|
+
userGreeting: userGreeting,
|
|
799
|
+
phoneNumber: phoneNumber
|
|
987
800
|
};
|
|
988
801
|
}, [userName, userMobileNumber, countryCode]),
|
|
989
|
-
userGreeting =
|
|
990
|
-
phoneNumber =
|
|
991
|
-
var
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
action_name: actionName.toLowerCase().replace(/[\s-]/g, '') + '_account_click',
|
|
995
|
-
action_type: 'click',
|
|
996
|
-
u_utm_source: (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic',
|
|
997
|
-
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;
|
|
998
807
|
};
|
|
999
808
|
};
|
|
1000
|
-
|
|
1001
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(text), ravenPayload, ravenPushCallback, ravenPageName);
|
|
1002
|
-
window.location.href = redirectLink;
|
|
1003
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1004
|
-
react.useCallback(function () {
|
|
1005
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(SIGN_OUT_TEXT), ravenPayload, ravenPushCallback, ravenPageName);
|
|
1006
|
-
handleLogoutClick();
|
|
1007
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, handleLogoutClick]);
|
|
1008
|
-
var positionAccountOptionsDiv = react.useCallback(function () {
|
|
809
|
+
react.useEffect(function () {
|
|
1009
810
|
var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
|
|
1010
811
|
var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
|
|
1011
|
-
|
|
1012
|
-
var headerBtnRight = headerAccBtn.getBoundingClientRect().right;
|
|
1013
|
-
accountOptionsElem
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
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
|
+
};
|
|
1017
818
|
positionAccountOptionsDiv();
|
|
1018
|
-
}, [
|
|
819
|
+
}, []);
|
|
1019
820
|
var renderUserData = function () {
|
|
1020
821
|
var renderContent = function (loading, content, variant, color) {
|
|
1021
822
|
return jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1022
823
|
variant: variant,
|
|
1023
824
|
color: color
|
|
1024
825
|
}, {
|
|
1025
|
-
children: loading ? jsxRuntime.jsx(
|
|
826
|
+
children: loading ? jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
1026
827
|
height: variant === 'HM3' ? '18px' : '12px',
|
|
1027
|
-
width: variant === 'HM3' ? '140px' : '200px'
|
|
828
|
+
width: variant === 'HM3' ? '140px' : '200px',
|
|
829
|
+
backgroundColor: '#efefef',
|
|
830
|
+
borderRadius: '8px'
|
|
1028
831
|
}) : content
|
|
1029
832
|
}));
|
|
1030
833
|
};
|
|
@@ -1060,7 +863,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
1060
863
|
}, {
|
|
1061
864
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
1062
865
|
padding: '16px',
|
|
1063
|
-
height: '
|
|
866
|
+
height: '72px'
|
|
1064
867
|
}, {
|
|
1065
868
|
children: renderUserData()
|
|
1066
869
|
})), jsxRuntime.jsx(RewardsSection, {}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
@@ -1069,7 +872,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
1069
872
|
padding: '8px',
|
|
1070
873
|
backgroundColor: 'white',
|
|
1071
874
|
rowGap: '8px',
|
|
1072
|
-
|
|
875
|
+
style: {
|
|
1073
876
|
borderBottomLeftRadius: 12,
|
|
1074
877
|
borderBottomRightRadius: 12
|
|
1075
878
|
}
|
|
@@ -1083,14 +886,12 @@ var AccountDropdownContent = function (_a) {
|
|
|
1083
886
|
padding: '8px',
|
|
1084
887
|
borderRadius: '8px',
|
|
1085
888
|
cursor: 'pointer',
|
|
1086
|
-
onClick:
|
|
1087
|
-
return handleAccountOptionsClick(text, redirectionLink);
|
|
1088
|
-
}
|
|
889
|
+
onClick: handleRedirectClick(redirectionLink)
|
|
1089
890
|
}, {
|
|
1090
891
|
children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1091
892
|
display: 'flex',
|
|
1092
893
|
cursor: 'pointer',
|
|
1093
|
-
|
|
894
|
+
style: {
|
|
1094
895
|
columnGap: '8px'
|
|
1095
896
|
}
|
|
1096
897
|
}, {
|
|
@@ -1107,7 +908,7 @@ var AccountDropdownContent = function (_a) {
|
|
|
1107
908
|
}))
|
|
1108
909
|
}), "account-option-".concat(text));
|
|
1109
910
|
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1110
|
-
|
|
911
|
+
style: {
|
|
1111
912
|
borderBottom: '1px dashed #E6E6E6'
|
|
1112
913
|
}
|
|
1113
914
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
@@ -1138,49 +939,29 @@ var AccountDropdownContent = function (_a) {
|
|
|
1138
939
|
};
|
|
1139
940
|
|
|
1140
941
|
var UserAccount = function () {
|
|
1141
|
-
var
|
|
1142
|
-
|
|
1143
|
-
ravenEventName = _a.ravenEventName,
|
|
1144
|
-
_b = _a.ravenPayload,
|
|
1145
|
-
ravenPayload = _b === void 0 ? {} : _b,
|
|
1146
|
-
ravenPushCallback = _a.ravenPushCallback,
|
|
1147
|
-
isUserLoggedIn = _a.isUserLoggedIn,
|
|
1148
|
-
loyaltyType = _a.loyaltyType,
|
|
1149
|
-
ravenPageName = _a.ravenPageName;
|
|
1150
|
-
var _c = useHoverDropdown({
|
|
942
|
+
var isNovacThemeEnabled = useHeaderContext().isNovacThemeEnabled;
|
|
943
|
+
var _a = useHoverDropdown({
|
|
1151
944
|
openDelay: 0
|
|
1152
945
|
}),
|
|
1153
|
-
isDropdownVisible =
|
|
1154
|
-
handleOnMouseEnter =
|
|
1155
|
-
handleOnMouseLeave =
|
|
1156
|
-
handleDropdownMouseEnter =
|
|
1157
|
-
handleDropdownMouseLeave =
|
|
1158
|
-
var
|
|
1159
|
-
scrolled =
|
|
1160
|
-
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];
|
|
1161
954
|
react.useEffect(function () {
|
|
1162
955
|
var handleScroll = function () {
|
|
1163
|
-
setScrolled(window.scrollY >=
|
|
956
|
+
setScrolled(window.scrollY >= 100);
|
|
1164
957
|
};
|
|
1165
958
|
window.addEventListener('scroll', handleScroll);
|
|
1166
959
|
return function () {
|
|
1167
960
|
return window.removeEventListener('scroll', handleScroll);
|
|
1168
961
|
};
|
|
1169
962
|
}, []);
|
|
1170
|
-
var
|
|
1171
|
-
var hoverColor =
|
|
1172
|
-
typographyColor = theme.typographyColor;
|
|
1173
|
-
var triggerRavenEventOnHover = react.useCallback(function () {
|
|
1174
|
-
var _a;
|
|
1175
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
1176
|
-
var defaultPayload = {
|
|
1177
|
-
action_name: "".concat(MY_ACCOUNT_TEXT.toLowerCase().replace(/[\s-]/g, ''), "_header_hover"),
|
|
1178
|
-
action_type: 'hover',
|
|
1179
|
-
u_utm_source: utmSource,
|
|
1180
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
1181
|
-
};
|
|
1182
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1183
|
-
}, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
|
|
963
|
+
var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
|
|
964
|
+
var hoverColor = effectiveNovacThemeEnabled ? '#FFB8A5' : '#FF4F17';
|
|
1184
965
|
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
1185
966
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1186
967
|
display: 'flex',
|
|
@@ -1189,19 +970,18 @@ var UserAccount = function () {
|
|
|
1189
970
|
borderRadius: '12px',
|
|
1190
971
|
height: '100%',
|
|
1191
972
|
cursor: 'pointer',
|
|
1192
|
-
|
|
973
|
+
style: {
|
|
1193
974
|
columnGap: 8,
|
|
1194
975
|
height: 64
|
|
1195
976
|
},
|
|
1196
977
|
onMouseEnter: function () {
|
|
1197
|
-
handleOnMouseEnter(0);
|
|
1198
|
-
triggerRavenEventOnHover();
|
|
978
|
+
return handleOnMouseEnter(0);
|
|
1199
979
|
},
|
|
1200
980
|
onMouseLeave: handleOnMouseLeave,
|
|
1201
981
|
id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
|
|
1202
982
|
}, {
|
|
1203
983
|
children: [jsxRuntime.jsx(ctDesignIcons.MyAccount, {
|
|
1204
|
-
color: isDropdownVisible ? hoverColor :
|
|
984
|
+
color: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1205
985
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1206
986
|
display: 'flex',
|
|
1207
987
|
flexDirection: 'row',
|
|
@@ -1212,13 +992,13 @@ var UserAccount = function () {
|
|
|
1212
992
|
css: {
|
|
1213
993
|
cursor: 'pointer'
|
|
1214
994
|
},
|
|
1215
|
-
colorCode: isDropdownVisible ? hoverColor :
|
|
995
|
+
colorCode: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1216
996
|
}, {
|
|
1217
|
-
children:
|
|
997
|
+
children: "My Account"
|
|
1218
998
|
})), jsxRuntime.jsx(ctDesignIcons.ChevronDown, {
|
|
1219
999
|
width: 20,
|
|
1220
1000
|
height: 20,
|
|
1221
|
-
fill: isDropdownVisible ? hoverColor :
|
|
1001
|
+
fill: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1222
1002
|
})]
|
|
1223
1003
|
}))]
|
|
1224
1004
|
})), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
@@ -1243,74 +1023,42 @@ var Header = function (props) {
|
|
|
1243
1023
|
}));
|
|
1244
1024
|
};
|
|
1245
1025
|
var HeaderContent = function () {
|
|
1246
|
-
var _a
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
scrolled = _f[0],
|
|
1262
|
-
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];
|
|
1263
1041
|
react.useEffect(function () {
|
|
1264
1042
|
var handleScroll = function () {
|
|
1265
|
-
setScrolled(window.scrollY >=
|
|
1043
|
+
setScrolled(window.scrollY >= 100);
|
|
1266
1044
|
};
|
|
1267
1045
|
window.addEventListener('scroll', handleScroll);
|
|
1268
1046
|
return function () {
|
|
1269
1047
|
return window.removeEventListener('scroll', handleScroll);
|
|
1270
1048
|
};
|
|
1271
1049
|
}, []);
|
|
1272
|
-
var
|
|
1273
|
-
var headerBackground =
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
fkcompanyColor = theme.fkcompanyColor,
|
|
1277
|
-
typographyColor = theme.typographyColor;
|
|
1278
|
-
var _g = useHoverDropdown({
|
|
1050
|
+
var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
|
|
1051
|
+
var headerBackground = effectiveNovacThemeEnabled ? 'transparent' : '#F7FAFF';
|
|
1052
|
+
var hoverColor = effectiveNovacThemeEnabled ? '#FFB8A5' : '#FF4F17';
|
|
1053
|
+
var _f = useHoverDropdown({
|
|
1279
1054
|
openDelay: 0
|
|
1280
1055
|
}),
|
|
1281
|
-
isDropdownVisible =
|
|
1282
|
-
hoveredElemIndex =
|
|
1283
|
-
handleOnMouseEnter =
|
|
1284
|
-
handleOnMouseLeave =
|
|
1285
|
-
handleDropdownMouseEnter =
|
|
1286
|
-
handleDropdownMouseLeave =
|
|
1287
|
-
var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
|
|
1288
|
-
var createPayload = react.useCallback(function (actionName, actionType) {
|
|
1289
|
-
return {
|
|
1290
|
-
action_name: actionName,
|
|
1291
|
-
action_type: actionType,
|
|
1292
|
-
u_utm_source: utmSource,
|
|
1293
|
-
loyalty_type: ravenLoyaltyTypes(loyaltyType)
|
|
1294
|
-
};
|
|
1295
|
-
}, [utmSource, loyaltyType]);
|
|
1296
|
-
var handleNavbarOptionsClick = react.useCallback(function (option) {
|
|
1297
|
-
if (option.isClickable && option.link) {
|
|
1298
|
-
var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_click");
|
|
1299
|
-
var payload = createPayload(actionName, 'click');
|
|
1300
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1301
|
-
window.location.href = option.link;
|
|
1302
|
-
}
|
|
1303
|
-
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1304
|
-
var handleHomeClick = react.useCallback(function () {
|
|
1305
|
-
var payload = createPayload('home_header_click', 'click');
|
|
1306
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1307
|
-
window.location.href = '/';
|
|
1308
|
-
}, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
|
|
1309
|
-
var triggerRavenEventOnHover = react.useCallback(function (option) {
|
|
1310
|
-
var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_hover");
|
|
1311
|
-
var payload = createPayload(actionName, 'hover');
|
|
1312
|
-
ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
|
|
1313
|
-
}, [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;
|
|
1314
1062
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1315
1063
|
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
1316
1064
|
display: 'flex',
|
|
@@ -1325,7 +1073,7 @@ var HeaderContent = function () {
|
|
|
1325
1073
|
css: {
|
|
1326
1074
|
gap: '24px',
|
|
1327
1075
|
flexShrink: 0,
|
|
1328
|
-
borderBottom:
|
|
1076
|
+
borderBottom: effectiveNovacThemeEnabled ? '' : '1px solid #E6E6E6',
|
|
1329
1077
|
transition: 'background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out'
|
|
1330
1078
|
}
|
|
1331
1079
|
}, {
|
|
@@ -1335,7 +1083,7 @@ var HeaderContent = function () {
|
|
|
1335
1083
|
justifyContent: 'space-between',
|
|
1336
1084
|
padding: '0 28px',
|
|
1337
1085
|
flex: 1,
|
|
1338
|
-
|
|
1086
|
+
style: {
|
|
1339
1087
|
gap: '24px',
|
|
1340
1088
|
maxWidth: 1440
|
|
1341
1089
|
}
|
|
@@ -1346,10 +1094,13 @@ var HeaderContent = function () {
|
|
|
1346
1094
|
alignItems: 'center',
|
|
1347
1095
|
justifyContent: 'center',
|
|
1348
1096
|
cursor: 'pointer',
|
|
1349
|
-
|
|
1097
|
+
paddingLeft: '16px',
|
|
1098
|
+
onClick: function () {
|
|
1099
|
+
window.location.href = '/';
|
|
1100
|
+
}
|
|
1350
1101
|
}, {
|
|
1351
1102
|
children: [jsxRuntime.jsx(ctDesignIcons.CTLogo, {
|
|
1352
|
-
fillColor:
|
|
1103
|
+
fillColor: effectiveNovacThemeEnabled ? '#FFF' : '#FF4F17'
|
|
1353
1104
|
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1354
1105
|
css: {
|
|
1355
1106
|
width: 12,
|
|
@@ -1359,7 +1110,7 @@ var HeaderContent = function () {
|
|
|
1359
1110
|
borderBottom: '1px solid #e0e0e0'
|
|
1360
1111
|
}
|
|
1361
1112
|
}), jsxRuntime.jsx(ctDesignIcons.Fkcompany, {
|
|
1362
|
-
color:
|
|
1113
|
+
color: effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1363
1114
|
})]
|
|
1364
1115
|
})), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1365
1116
|
display: 'flex',
|
|
@@ -1376,18 +1127,11 @@ var HeaderContent = function () {
|
|
|
1376
1127
|
columnGap: '4px'
|
|
1377
1128
|
}, {
|
|
1378
1129
|
children: NAVBAR_OPTIONS.map(function (option, index) {
|
|
1379
|
-
var text = option.text,
|
|
1380
|
-
LeftIcon = option.lefticon,
|
|
1381
|
-
RightIcon = option.rightIcon,
|
|
1382
|
-
isHoverable = option.isHoverable;
|
|
1383
1130
|
var isHovered = hoveredElemIndex === index;
|
|
1384
1131
|
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
1385
1132
|
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1386
1133
|
onMouseEnter: function () {
|
|
1387
|
-
handleOnMouseEnter(index);
|
|
1388
|
-
if (option.isHoverable) {
|
|
1389
|
-
triggerRavenEventOnHover(option);
|
|
1390
|
-
}
|
|
1134
|
+
return handleOnMouseEnter(index);
|
|
1391
1135
|
},
|
|
1392
1136
|
onMouseLeave: handleOnMouseLeave,
|
|
1393
1137
|
display: 'flex',
|
|
@@ -1399,11 +1143,13 @@ var HeaderContent = function () {
|
|
|
1399
1143
|
columnGap: 8,
|
|
1400
1144
|
height: '64px',
|
|
1401
1145
|
onClick: function () {
|
|
1402
|
-
|
|
1146
|
+
if (option.link && option.isClickable) {
|
|
1147
|
+
window.location.href = option.link;
|
|
1148
|
+
}
|
|
1403
1149
|
}
|
|
1404
1150
|
}, {
|
|
1405
|
-
children: [jsxRuntime.jsx(
|
|
1406
|
-
color: isHovered ? hoverColor :
|
|
1151
|
+
children: [jsxRuntime.jsx(option.lefticon, {
|
|
1152
|
+
color: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1407
1153
|
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1408
1154
|
display: 'flex',
|
|
1409
1155
|
flexDirection: 'row',
|
|
@@ -1411,31 +1157,31 @@ var HeaderContent = function () {
|
|
|
1411
1157
|
}, {
|
|
1412
1158
|
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1413
1159
|
variant: 'B2',
|
|
1414
|
-
colorCode: isHovered ? hoverColor :
|
|
1160
|
+
colorCode: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A',
|
|
1415
1161
|
isClickable: true
|
|
1416
1162
|
}, {
|
|
1417
|
-
children: text
|
|
1418
|
-
})),
|
|
1163
|
+
children: option.text
|
|
1164
|
+
})), option.rightIcon && jsxRuntime.jsx(option.rightIcon, {
|
|
1419
1165
|
width: 20,
|
|
1420
1166
|
height: 20,
|
|
1421
|
-
fill: isHovered ? hoverColor :
|
|
1167
|
+
fill: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
|
|
1422
1168
|
})]
|
|
1423
1169
|
}))]
|
|
1424
1170
|
}), "nav-option-".concat(index)), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
1425
|
-
show: hoveredElemIndex === index && isHoverable && isDropdownVisible,
|
|
1171
|
+
show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible,
|
|
1426
1172
|
marginTop: '64px',
|
|
1427
1173
|
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
1428
1174
|
handleDropdownMouseLeave: handleDropdownMouseLeave,
|
|
1429
1175
|
onMaskClick: handleDropdownMouseLeave
|
|
1430
1176
|
}, {
|
|
1431
1177
|
children: jsxRuntime.jsx(BusinessDropdownContent, {
|
|
1432
|
-
isOpen: hoveredElemIndex === index && isHoverable && isDropdownVisible
|
|
1178
|
+
isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible
|
|
1433
1179
|
})
|
|
1434
1180
|
}))]
|
|
1435
1181
|
});
|
|
1436
1182
|
})
|
|
1437
1183
|
})), isUserLoggedIn && jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1438
|
-
|
|
1184
|
+
style: {
|
|
1439
1185
|
width: 12,
|
|
1440
1186
|
margin: '0 -18px',
|
|
1441
1187
|
transform: 'rotate(90deg)',
|
|
@@ -1449,21 +1195,21 @@ var HeaderContent = function () {
|
|
|
1449
1195
|
}, {
|
|
1450
1196
|
children: jsxRuntime.jsx(UserAccount, {})
|
|
1451
1197
|
})) : jsxRuntime.jsx(ctDesignButton.Button, tslib.__assign({
|
|
1452
|
-
className: "".concat(
|
|
1198
|
+
className: "fw-400 fs-14 ".concat(effectiveNovacThemeEnabled ? 'novac-login-button' : 'login-button'),
|
|
1453
1199
|
onClick: onLoginButtonClick,
|
|
1454
|
-
|
|
1200
|
+
style: {
|
|
1455
1201
|
width: 153,
|
|
1456
1202
|
height: 40,
|
|
1457
|
-
border:
|
|
1203
|
+
border: effectiveNovacThemeEnabled ? '1px solid #FFF' : '1px solid #1A1A1A'
|
|
1458
1204
|
},
|
|
1459
1205
|
loading: false
|
|
1460
1206
|
}, {
|
|
1461
1207
|
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1462
1208
|
componentNode: 'span',
|
|
1463
1209
|
variant: 'L2',
|
|
1464
|
-
color:
|
|
1210
|
+
color: effectiveNovacThemeEnabled ? 'neutral' : 'primary'
|
|
1465
1211
|
}, {
|
|
1466
|
-
children:
|
|
1212
|
+
children: "Login"
|
|
1467
1213
|
}))
|
|
1468
1214
|
}))
|
|
1469
1215
|
})]
|