@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-test.0 → 1.2.0-SNAPSHOT-styled-header-test.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/LobsHeader/type.d.ts +8 -1
- package/dist/LobsHeader/type.d.ts.map +1 -1
- package/dist/UserAccount/UserAccountDropdown.d.ts +0 -1
- package/dist/UserAccount/UserAccountDropdown.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 +1021 -468
- package/dist/ct-design-header.cjs.js.map +1 -1
- package/dist/ct-design-header.esm.js +1018 -469
- package/dist/ct-design-header.esm.js.map +1 -1
- package/dist/ct-design-header.umd.js +1034 -472
- package/dist/ct-design-header.umd.js.map +1 -1
- package/dist/type.d.ts +2 -1
- package/dist/type.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -9,366 +9,492 @@ var ctDesignDivider = require('@cleartrip/ct-design-divider');
|
|
|
9
9
|
var ctDesignIcons = require('@cleartrip/ct-design-icons');
|
|
10
10
|
var react = require('react');
|
|
11
11
|
var ctDesignShimmer = require('@cleartrip/ct-design-shimmer');
|
|
12
|
+
var styled = require('styled-components');
|
|
13
|
+
|
|
14
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
12
17
|
|
|
13
18
|
var OFFERS_URL = 'all-offers/?categories=flights';
|
|
14
19
|
var MY_TRIPS_URL = '/account/trips';
|
|
15
20
|
var SUPPORT_URL = '/support';
|
|
16
|
-
var NAVBAR_OPTIONS = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
isHoverable: false,
|
|
41
|
-
isClickable: true,
|
|
42
|
-
link: SUPPORT_URL,
|
|
43
|
-
},
|
|
44
|
-
];
|
|
21
|
+
var NAVBAR_OPTIONS = [{
|
|
22
|
+
lefticon: ctDesignIcons.Offers,
|
|
23
|
+
text: 'Offers',
|
|
24
|
+
isHoverable: false,
|
|
25
|
+
isClickable: true,
|
|
26
|
+
link: OFFERS_URL
|
|
27
|
+
}, {
|
|
28
|
+
lefticon: ctDesignIcons.BusinessBag,
|
|
29
|
+
text: 'Business',
|
|
30
|
+
rightIcon: ctDesignIcons.ChevronDown,
|
|
31
|
+
isHoverable: true
|
|
32
|
+
}, {
|
|
33
|
+
lefticon: ctDesignIcons.MyTrips,
|
|
34
|
+
text: 'My Trips',
|
|
35
|
+
isHoverable: false,
|
|
36
|
+
isClickable: true,
|
|
37
|
+
link: MY_TRIPS_URL
|
|
38
|
+
}, {
|
|
39
|
+
lefticon: ctDesignIcons.SupportIcon,
|
|
40
|
+
text: 'Support',
|
|
41
|
+
isHoverable: false,
|
|
42
|
+
isClickable: true,
|
|
43
|
+
link: SUPPORT_URL
|
|
44
|
+
}];
|
|
45
45
|
var LOBS = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
FLIGHTS: 'Flights',
|
|
47
|
+
HOTELS: 'Hotels',
|
|
48
|
+
TRAIN: 'Trains',
|
|
49
|
+
PACKAGES: 'Packages',
|
|
50
|
+
BUSES: 'Buses'
|
|
51
51
|
};
|
|
52
|
-
var LOB_DATA = [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
title: 'MICE',
|
|
92
|
-
subtitle: 'For corporate events',
|
|
93
|
-
details: 'An end-to-end management solution for all your corporate events',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
title: 'API',
|
|
97
|
-
subtitle: 'For developers',
|
|
98
|
-
details: 'Unlock seamless integration and scale with our powerful, reliable APIs',
|
|
99
|
-
},
|
|
100
|
-
];
|
|
52
|
+
var LOB_DATA = [{
|
|
53
|
+
title: LOBS.FLIGHTS,
|
|
54
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/flight_uhp.png?cache=true',
|
|
55
|
+
link: '/flights'
|
|
56
|
+
}, {
|
|
57
|
+
title: LOBS.HOTELS,
|
|
58
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/hotel_uhp.png?cache=true',
|
|
59
|
+
link: '/hotels'
|
|
60
|
+
}, {
|
|
61
|
+
title: LOBS.BUSES,
|
|
62
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/bus_uhp.png?cache=true',
|
|
63
|
+
link: '/bus'
|
|
64
|
+
}, {
|
|
65
|
+
title: LOBS.TRAIN,
|
|
66
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/train_uhp.png?cache=true',
|
|
67
|
+
link: '/'
|
|
68
|
+
}, {
|
|
69
|
+
title: LOBS.PACKAGES,
|
|
70
|
+
image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/holiday_uhp.png?cache=true',
|
|
71
|
+
link: '/#'
|
|
72
|
+
}];
|
|
73
|
+
var bdConfig = [{
|
|
74
|
+
title: 'AgentBox',
|
|
75
|
+
subtitle: 'For travel agents',
|
|
76
|
+
details: 'One-stop travel solution offering the best deals to our travel agency partners'
|
|
77
|
+
}, {
|
|
78
|
+
title: 'OutOfOffice',
|
|
79
|
+
subtitle: 'For startups, corporates and SMEs',
|
|
80
|
+
details: 'Manage corporate business travel, smartly'
|
|
81
|
+
}, {
|
|
82
|
+
title: 'MICE',
|
|
83
|
+
subtitle: 'For corporate events',
|
|
84
|
+
details: 'An end-to-end management solution for all your corporate events'
|
|
85
|
+
}, {
|
|
86
|
+
title: 'API',
|
|
87
|
+
subtitle: 'For developers',
|
|
88
|
+
details: 'Unlock seamless integration and scale with our powerful, reliable APIs'
|
|
89
|
+
}];
|
|
101
90
|
var BUSINESS_DROPDOWN_HEADING = 'Other business services';
|
|
102
91
|
|
|
103
92
|
var LobsHeader = function (_a) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
93
|
+
var selectedLOB = _a.selectedLOB;
|
|
94
|
+
return jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
95
|
+
className: 'flex p-4 flex-middle flex-center p-sticky',
|
|
96
|
+
css: {
|
|
97
|
+
gap: 40,
|
|
98
|
+
height: 64,
|
|
99
|
+
background: ' #F3F5FA',
|
|
100
|
+
top: 64,
|
|
101
|
+
zIndex: 2
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
children: LOB_DATA.map(function (item, index) {
|
|
105
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
106
|
+
className: 'flex flex-middle c-pointer',
|
|
107
|
+
css: {
|
|
108
|
+
gap: 8,
|
|
109
|
+
background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
|
|
110
|
+
borderRadius: selectedLOB === item.title ? '40px' : '0',
|
|
111
|
+
padding: selectedLOB === item.title ? '8px 16px 8px 8px' : '0'
|
|
112
|
+
},
|
|
113
|
+
onClick: function () {
|
|
114
|
+
window.location.href = item.link;
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
children: [jsxRuntime.jsx("img", {
|
|
118
|
+
src: item.image,
|
|
119
|
+
alt: item.title,
|
|
120
|
+
width: 32,
|
|
121
|
+
height: 32
|
|
122
|
+
}), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
123
|
+
variant: 'P1',
|
|
124
|
+
style: {
|
|
125
|
+
fontWeight: selectedLOB === item.title ? 600 : 500
|
|
126
|
+
},
|
|
127
|
+
isClickable: true
|
|
128
|
+
}, {
|
|
129
|
+
children: item.title
|
|
130
|
+
}))]
|
|
131
|
+
}), index);
|
|
132
|
+
})
|
|
133
|
+
}));
|
|
121
134
|
};
|
|
122
135
|
|
|
123
136
|
var useDelayedUnmount = function (show, unmountDelay) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
137
|
+
var _a = react.useState(show),
|
|
138
|
+
showComponent = _a[0],
|
|
139
|
+
setShowComponent = _a[1];
|
|
140
|
+
var timerRef = react.useRef();
|
|
141
|
+
react.useEffect(function () {
|
|
142
|
+
if (!show) {
|
|
143
|
+
timerRef.current = setTimeout(function () {
|
|
144
|
+
setShowComponent(false);
|
|
145
|
+
}, unmountDelay);
|
|
146
|
+
} else {
|
|
147
|
+
setShowComponent(show);
|
|
148
|
+
}
|
|
149
|
+
return function () {
|
|
150
|
+
(timerRef === null || timerRef === void 0 ? void 0 : timerRef.current) && clearTimeout(timerRef.current);
|
|
151
|
+
};
|
|
152
|
+
}, [show]);
|
|
153
|
+
return showComponent;
|
|
140
154
|
};
|
|
141
155
|
var useMountTransition = function (isMounted, unmountDelay) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
var _a = react.useState(false),
|
|
157
|
+
hasTransitionedIn = _a[0],
|
|
158
|
+
setHasTransitionedIn = _a[1];
|
|
159
|
+
var timeoutIdRef = react.useRef();
|
|
160
|
+
react.useEffect(function () {
|
|
161
|
+
if (isMounted && !hasTransitionedIn) {
|
|
162
|
+
setTimeout(function () {
|
|
163
|
+
setHasTransitionedIn(true);
|
|
164
|
+
}, 0);
|
|
165
|
+
} else if (!isMounted && hasTransitionedIn) {
|
|
166
|
+
timeoutIdRef.current = setTimeout(function () {
|
|
167
|
+
return setHasTransitionedIn(false);
|
|
168
|
+
}, unmountDelay);
|
|
169
|
+
}
|
|
170
|
+
return function () {
|
|
171
|
+
if (timeoutIdRef && timeoutIdRef.current) {
|
|
172
|
+
clearTimeout(timeoutIdRef.current);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, [unmountDelay, isMounted]);
|
|
176
|
+
return hasTransitionedIn;
|
|
160
177
|
};
|
|
161
178
|
|
|
162
179
|
function HeaderAnimatedMask(_a) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
var children = _a.children,
|
|
181
|
+
onMaskClick = _a.onMaskClick,
|
|
182
|
+
show = _a.show,
|
|
183
|
+
marginTop = _a.marginTop,
|
|
184
|
+
handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
|
|
185
|
+
handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
|
|
186
|
+
react.useEffect(function () {
|
|
187
|
+
if (show) {
|
|
188
|
+
document.body.style.overflow = 'hidden';
|
|
189
|
+
}
|
|
190
|
+
return function () {
|
|
191
|
+
document.body.style.overflow = 'initial';
|
|
192
|
+
};
|
|
193
|
+
}, [show]);
|
|
194
|
+
var showFlagProxy = useDelayedUnmount(show, 300);
|
|
195
|
+
var triggerTransition = useMountTransition(show, 100);
|
|
196
|
+
var triggerOpenTransition = triggerTransition;
|
|
197
|
+
console.log(show, showFlagProxy, 'custom hook');
|
|
198
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
199
|
+
children: [showFlagProxy && jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
200
|
+
id: 'mask-container',
|
|
201
|
+
css: {
|
|
202
|
+
position: 'fixed',
|
|
203
|
+
backgroundColor: '#000',
|
|
204
|
+
opacity: triggerOpenTransition ? 0.4 : 0,
|
|
205
|
+
width: '100%',
|
|
206
|
+
height: '100vh',
|
|
207
|
+
left: 0,
|
|
208
|
+
top: marginTop || 0,
|
|
209
|
+
zIndex: 9,
|
|
210
|
+
transition: 'opacity 300ms ease-in'
|
|
211
|
+
},
|
|
212
|
+
onClick: onMaskClick
|
|
213
|
+
}), showFlagProxy && jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
214
|
+
onMouseEnter: handleDropdownMouseEnter,
|
|
215
|
+
onMouseLeave: handleDropdownMouseLeave
|
|
216
|
+
}, {
|
|
217
|
+
children: children
|
|
218
|
+
}))]
|
|
219
|
+
});
|
|
187
220
|
}
|
|
188
221
|
|
|
189
222
|
var MIN_CLOSE_DELAY = 150;
|
|
190
223
|
var useHoverDropdown = function (_a) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
handleOnMouseEnter: handleOnMouseEnter,
|
|
250
|
-
handleOnMouseLeave: handleOnMouseLeave,
|
|
251
|
-
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
252
|
-
handleDropdownMouseLeave: handleDropdownMouseLeave,
|
|
224
|
+
var _b = _a === void 0 ? {} : _a,
|
|
225
|
+
_c = _b.closeDelay,
|
|
226
|
+
closeDelayArg = _c === void 0 ? 300 : _c,
|
|
227
|
+
_d = _b.openDelay,
|
|
228
|
+
openDelay = _d === void 0 ? 500 : _d;
|
|
229
|
+
var closeDelay = Math.max(closeDelayArg, MIN_CLOSE_DELAY);
|
|
230
|
+
var _e = react.useState(false),
|
|
231
|
+
isDropdownVisible = _e[0],
|
|
232
|
+
setIsDropdownVisible = _e[1];
|
|
233
|
+
var _f = react.useState(null),
|
|
234
|
+
hoveredElemIndex = _f[0],
|
|
235
|
+
setHoveredElemIndex = _f[1];
|
|
236
|
+
var timeoutRef = react.useRef(null);
|
|
237
|
+
var openTimeoutRef = react.useRef(null);
|
|
238
|
+
var cancelElementHover = react.useRef(false);
|
|
239
|
+
var handleOnMouseEnter = react.useCallback(function (index) {
|
|
240
|
+
console.log('handleOnMouseEnter');
|
|
241
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
242
|
+
if (openTimeoutRef.current) clearTimeout(openTimeoutRef.current);
|
|
243
|
+
cancelElementHover.current = false;
|
|
244
|
+
openTimeoutRef.current = setTimeout(function () {
|
|
245
|
+
setIsDropdownVisible(true);
|
|
246
|
+
if (!cancelElementHover.current) {
|
|
247
|
+
setHoveredElemIndex(index);
|
|
248
|
+
}
|
|
249
|
+
}, openDelay);
|
|
250
|
+
}, [openDelay]);
|
|
251
|
+
var handleOnMouseLeave = react.useCallback(function () {
|
|
252
|
+
console.log('handleMouseLeave');
|
|
253
|
+
cancelElementHover.current = true;
|
|
254
|
+
timeoutRef.current = setTimeout(function () {
|
|
255
|
+
setIsDropdownVisible(false);
|
|
256
|
+
setHoveredElemIndex(null);
|
|
257
|
+
}, closeDelay);
|
|
258
|
+
}, [closeDelay]);
|
|
259
|
+
var handleDropdownMouseEnter = react.useCallback(function () {
|
|
260
|
+
console.log('handleDropdownMouseEnter');
|
|
261
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
262
|
+
}, []);
|
|
263
|
+
var handleDropdownMouseLeave = react.useCallback(function () {
|
|
264
|
+
console.log('handleDropdownMouseLeave');
|
|
265
|
+
cancelElementHover.current = true;
|
|
266
|
+
(timeoutRef === null || timeoutRef === void 0 ? void 0 : timeoutRef.current) && clearTimeout(timeoutRef.current);
|
|
267
|
+
timeoutRef.current = setTimeout(function () {
|
|
268
|
+
setIsDropdownVisible(false);
|
|
269
|
+
setHoveredElemIndex(null);
|
|
270
|
+
}, closeDelay);
|
|
271
|
+
}, []);
|
|
272
|
+
react.useEffect(function () {
|
|
273
|
+
var handleMouseLeaveWindow = function (event) {
|
|
274
|
+
if (event.clientY <= 0) {
|
|
275
|
+
setIsDropdownVisible(false);
|
|
276
|
+
setHoveredElemIndex(null);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
window.addEventListener('mouseleave', handleMouseLeaveWindow);
|
|
280
|
+
return function () {
|
|
281
|
+
window.removeEventListener('mouseleave', handleMouseLeaveWindow);
|
|
253
282
|
};
|
|
283
|
+
}, []);
|
|
284
|
+
return {
|
|
285
|
+
isDropdownVisible: isDropdownVisible,
|
|
286
|
+
hoveredElemIndex: hoveredElemIndex,
|
|
287
|
+
handleOnMouseEnter: handleOnMouseEnter,
|
|
288
|
+
handleOnMouseLeave: handleOnMouseLeave,
|
|
289
|
+
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
290
|
+
handleDropdownMouseLeave: handleDropdownMouseLeave
|
|
291
|
+
};
|
|
254
292
|
};
|
|
255
293
|
|
|
256
294
|
var useDropdownAnimation = function (isOpen) {
|
|
257
|
-
|
|
258
|
-
|
|
295
|
+
var containerRef = react.useRef(null);
|
|
296
|
+
var openDropdown = function () {
|
|
297
|
+
if (containerRef.current) {
|
|
298
|
+
var fullHeight_1 = containerRef.current.scrollHeight;
|
|
299
|
+
containerRef.current.style.maxHeight = "".concat(fullHeight_1 / 2, "px");
|
|
300
|
+
containerRef.current.style.opacity = '0';
|
|
301
|
+
requestAnimationFrame(function () {
|
|
259
302
|
if (containerRef.current) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
requestAnimationFrame(function () {
|
|
264
|
-
if (containerRef.current) {
|
|
265
|
-
containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
|
|
266
|
-
containerRef.current.style.maxHeight = "".concat(fullHeight_1, "px");
|
|
267
|
-
containerRef.current.style.opacity = '1';
|
|
268
|
-
}
|
|
269
|
-
});
|
|
303
|
+
containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
|
|
304
|
+
containerRef.current.style.maxHeight = "".concat(fullHeight_1, "px");
|
|
305
|
+
containerRef.current.style.opacity = '1';
|
|
270
306
|
}
|
|
271
|
-
|
|
272
|
-
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
var closeDropdown = function () {
|
|
311
|
+
if (containerRef.current) {
|
|
312
|
+
var fullHeight = containerRef.current.scrollHeight;
|
|
313
|
+
containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
|
|
314
|
+
containerRef.current.style.maxHeight = "".concat(fullHeight / 2, "px");
|
|
315
|
+
containerRef.current.style.opacity = '0';
|
|
316
|
+
setTimeout(function () {
|
|
273
317
|
if (containerRef.current) {
|
|
274
|
-
|
|
275
|
-
containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
|
|
276
|
-
containerRef.current.style.maxHeight = "".concat(fullHeight / 2, "px");
|
|
277
|
-
containerRef.current.style.opacity = '0';
|
|
278
|
-
setTimeout(function () {
|
|
279
|
-
if (containerRef.current) {
|
|
280
|
-
containerRef.current.style.maxHeight = '0px';
|
|
281
|
-
}
|
|
282
|
-
}, 300);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
react.useEffect(function () {
|
|
286
|
-
if (isOpen) {
|
|
287
|
-
openDropdown();
|
|
318
|
+
containerRef.current.style.maxHeight = '0px';
|
|
288
319
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
320
|
+
}, 300);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
react.useEffect(function () {
|
|
324
|
+
if (isOpen) {
|
|
325
|
+
openDropdown();
|
|
326
|
+
} else {
|
|
327
|
+
closeDropdown();
|
|
328
|
+
}
|
|
329
|
+
}, [isOpen]);
|
|
330
|
+
return {
|
|
331
|
+
containerRef: containerRef
|
|
332
|
+
};
|
|
294
333
|
};
|
|
295
334
|
|
|
296
335
|
var BusinessDropdownContent = function (_a) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
336
|
+
var isOpen = _a.isOpen;
|
|
337
|
+
var _b = react.useState(0),
|
|
338
|
+
leftPosition = _b[0],
|
|
339
|
+
setLeftPosition = _b[1];
|
|
340
|
+
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
341
|
+
react.useEffect(function () {
|
|
342
|
+
var updatePosition = function () {
|
|
343
|
+
if (containerRef.current) {
|
|
344
|
+
var screenWidth = window.innerWidth;
|
|
345
|
+
var containerWidth = containerRef.current.offsetWidth || 0;
|
|
346
|
+
setLeftPosition((screenWidth - containerWidth) / 2);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
updatePosition();
|
|
350
|
+
window.addEventListener('resize', updatePosition);
|
|
351
|
+
return function () {
|
|
352
|
+
return window.removeEventListener('resize', updatePosition);
|
|
353
|
+
};
|
|
354
|
+
}, []);
|
|
355
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
356
|
+
ref: containerRef,
|
|
357
|
+
className: 'bg-neutral-100 o-hidden',
|
|
358
|
+
css: {
|
|
359
|
+
top: '76px',
|
|
360
|
+
position: 'fixed',
|
|
361
|
+
left: "".concat(leftPosition, "px"),
|
|
362
|
+
borderRadius: 24,
|
|
363
|
+
boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
|
|
364
|
+
width: 'fit-content',
|
|
365
|
+
zIndex: 1002,
|
|
366
|
+
opacity: 0
|
|
367
|
+
}
|
|
368
|
+
}, {
|
|
369
|
+
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
370
|
+
className: 'px-6 py-5',
|
|
371
|
+
backgroundColor: '#FFF1EC'
|
|
372
|
+
}, {
|
|
373
|
+
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
374
|
+
variant: 'HM2',
|
|
375
|
+
style: {
|
|
376
|
+
lineHeight: '24px'
|
|
377
|
+
}
|
|
378
|
+
}, {
|
|
379
|
+
children: BUSINESS_DROPDOWN_HEADING
|
|
380
|
+
}))
|
|
381
|
+
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
382
|
+
className: 'flex flex-row p-6',
|
|
383
|
+
css: {
|
|
384
|
+
columnGap: '48px',
|
|
385
|
+
width: 'fit-content'
|
|
386
|
+
}
|
|
387
|
+
}, {
|
|
388
|
+
children: bdConfig.map(function (_a) {
|
|
389
|
+
var title = _a.title,
|
|
390
|
+
subtitle = _a.subtitle,
|
|
391
|
+
details = _a.details;
|
|
392
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
393
|
+
css: {
|
|
394
|
+
width: '200px'
|
|
395
|
+
},
|
|
396
|
+
className: 'bd-hover-container c-pointer'
|
|
397
|
+
}, {
|
|
398
|
+
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
399
|
+
className: 'flex flex-row flex-middle',
|
|
400
|
+
style: {
|
|
401
|
+
columnGap: '8px'
|
|
306
402
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
403
|
+
}, {
|
|
404
|
+
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
405
|
+
variant: 'HM2',
|
|
406
|
+
className: 'color-orange-on-hover'
|
|
407
|
+
}, {
|
|
408
|
+
children: title
|
|
409
|
+
})), jsxRuntime.jsx(AnimatedArrow, {})]
|
|
410
|
+
})), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
411
|
+
variant: 'B3',
|
|
412
|
+
className: 'mt-1',
|
|
413
|
+
css: {
|
|
414
|
+
opacity: 0.75
|
|
415
|
+
}
|
|
416
|
+
}, {
|
|
417
|
+
children: subtitle
|
|
418
|
+
})), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
419
|
+
variant: 'P3',
|
|
420
|
+
color: 'subheading',
|
|
421
|
+
className: 'mt-3'
|
|
422
|
+
}, {
|
|
423
|
+
children: details
|
|
424
|
+
}))]
|
|
425
|
+
}), title);
|
|
426
|
+
})
|
|
427
|
+
}))]
|
|
428
|
+
}));
|
|
325
429
|
};
|
|
326
430
|
var AnimatedArrow = function () {
|
|
327
|
-
|
|
431
|
+
return jsxRuntime.jsxs("div", tslib.__assign({
|
|
432
|
+
className: 'bd-arrow-container'
|
|
433
|
+
}, {
|
|
434
|
+
children: [jsxRuntime.jsx("div", tslib.__assign({
|
|
435
|
+
className: 'bd-arrow-wrapper'
|
|
436
|
+
}, {
|
|
437
|
+
children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
|
|
438
|
+
})), jsxRuntime.jsx("div", tslib.__assign({
|
|
439
|
+
className: 'bd-arrow-wrapper'
|
|
440
|
+
}, {
|
|
441
|
+
children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
|
|
442
|
+
})), jsxRuntime.jsx("div", tslib.__assign({
|
|
443
|
+
className: 'bd-arrow-wrapper'
|
|
444
|
+
}, {
|
|
445
|
+
children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
|
|
446
|
+
}))]
|
|
447
|
+
}));
|
|
328
448
|
};
|
|
329
449
|
|
|
330
|
-
var ACCOUNT_OPTIONS_POPUP_CONFIG = [
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
450
|
+
var ACCOUNT_OPTIONS_POPUP_CONFIG = [{
|
|
451
|
+
text: 'My Profile',
|
|
452
|
+
icon: jsxRuntime.jsx(ctDesignIcons.MyAccount, {
|
|
453
|
+
width: 24,
|
|
454
|
+
height: 24
|
|
455
|
+
}),
|
|
456
|
+
redirectionLink: '/accounts/profile'
|
|
457
|
+
}, {
|
|
458
|
+
text: 'My Trips',
|
|
459
|
+
icon: jsxRuntime.jsx(ctDesignIcons.MyTrips, {
|
|
460
|
+
width: 24,
|
|
461
|
+
height: 24
|
|
462
|
+
}),
|
|
463
|
+
redirectionLink: '/accounts/trips'
|
|
464
|
+
}, {
|
|
465
|
+
text: 'Saved Cards',
|
|
466
|
+
icon: jsxRuntime.jsx(ctDesignIcons.SavedCard, {}),
|
|
467
|
+
redirectionLink: '/accounts/expressway'
|
|
468
|
+
}, {
|
|
469
|
+
text: 'Saved Travellers',
|
|
470
|
+
icon: jsxRuntime.jsx(ctDesignIcons.Travellers, {
|
|
471
|
+
width: 24,
|
|
472
|
+
height: 24
|
|
473
|
+
}),
|
|
474
|
+
redirectionLink: '/account/travellers'
|
|
475
|
+
}, {
|
|
476
|
+
text: 'Hi-Five',
|
|
477
|
+
icon: jsxRuntime.jsx(ctDesignIcons.HiFive, {}),
|
|
478
|
+
redirectionLink: '/accounts/hi-five?src=fh'
|
|
479
|
+
}, {
|
|
480
|
+
text: 'Wallet',
|
|
481
|
+
icon: jsxRuntime.jsx(ctDesignIcons.Wallet, {
|
|
482
|
+
width: 24,
|
|
483
|
+
height: 24
|
|
484
|
+
}),
|
|
485
|
+
redirectionLink: '/accounts/wallet'
|
|
486
|
+
}, {
|
|
487
|
+
text: 'Settings',
|
|
488
|
+
icon: jsxRuntime.jsx(ctDesignIcons.SettingsCog, {
|
|
489
|
+
width: 24,
|
|
490
|
+
height: 24
|
|
491
|
+
}),
|
|
492
|
+
redirectionLink: '/account/settings'
|
|
493
|
+
}, {
|
|
494
|
+
text: 'Privacy Rights',
|
|
495
|
+
icon: jsxRuntime.jsx(ctDesignIcons.PrivacyRights, {}),
|
|
496
|
+
redirectionLink: 'accounts/personal-data-dashboard'
|
|
497
|
+
}];
|
|
372
498
|
var SIGN_OUT_TEXT = 'Logout';
|
|
373
499
|
var LOGGEDIN_USER_TEXT = 'You are logged in with';
|
|
374
500
|
var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
|
|
@@ -376,173 +502,600 @@ var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
|
|
|
376
502
|
var ACCOUNT_OPTIONS_CONTAINER_WIDTH = 328;
|
|
377
503
|
|
|
378
504
|
var LoyaltyChip = function (_a) {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
505
|
+
var icon = _a.icon,
|
|
506
|
+
borderGradient = _a.borderGradient,
|
|
507
|
+
backgroundGradient = _a.backgroundGradient,
|
|
508
|
+
handleChipClick = _a.handleChipClick;
|
|
509
|
+
var _b = react.useState(false),
|
|
510
|
+
isHovered = _b[0],
|
|
511
|
+
setIsHovered = _b[1];
|
|
512
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
513
|
+
className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer',
|
|
514
|
+
style: {
|
|
515
|
+
height: 32,
|
|
516
|
+
paddingLeft: 8,
|
|
517
|
+
transition: 'padding-right 0.2s ease-in-out',
|
|
518
|
+
paddingRight: isHovered ? 4 : 8
|
|
519
|
+
},
|
|
520
|
+
onMouseEnter: function () {
|
|
521
|
+
return setIsHovered(true);
|
|
522
|
+
},
|
|
523
|
+
onMouseLeave: function () {
|
|
524
|
+
return setIsHovered(false);
|
|
525
|
+
},
|
|
526
|
+
onClick: handleChipClick
|
|
527
|
+
}, {
|
|
528
|
+
children: [jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
529
|
+
style: {
|
|
530
|
+
content: '""',
|
|
531
|
+
position: 'absolute',
|
|
532
|
+
inset: 0,
|
|
533
|
+
borderRadius: 'inherit',
|
|
534
|
+
background: backgroundGradient,
|
|
535
|
+
zIndex: -2
|
|
536
|
+
}
|
|
537
|
+
}), jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
538
|
+
style: {
|
|
539
|
+
content: '""',
|
|
540
|
+
position: 'absolute',
|
|
541
|
+
inset: 0,
|
|
542
|
+
borderRadius: 'inherit',
|
|
543
|
+
padding: '1px',
|
|
544
|
+
background: borderGradient,
|
|
545
|
+
WebkitMask: 'linear-gradient(white, white) content-box, linear-gradient(white, white)',
|
|
546
|
+
WebkitMaskComposite: 'destination-out',
|
|
547
|
+
maskComposite: 'exclude',
|
|
548
|
+
zIndex: -1
|
|
549
|
+
}
|
|
550
|
+
}), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
551
|
+
className: 'flex flex-middle p-relative'
|
|
552
|
+
}, {
|
|
553
|
+
children: icon
|
|
554
|
+
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
555
|
+
className: 'flex flex-middle o-hidden',
|
|
556
|
+
style: {
|
|
557
|
+
maxWidth: isHovered ? 16 : 0,
|
|
558
|
+
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
559
|
+
opacity: isHovered ? 0.5 : 0
|
|
560
|
+
}
|
|
561
|
+
}, {
|
|
562
|
+
children: jsxRuntime.jsx(ctDesignIcons.HeaderChevronRight, {
|
|
563
|
+
color: 'white'
|
|
564
|
+
})
|
|
565
|
+
}))]
|
|
566
|
+
}));
|
|
409
567
|
};
|
|
410
568
|
|
|
411
569
|
var _a;
|
|
412
570
|
var LoyaltyType;
|
|
413
571
|
(function (LoyaltyType) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
572
|
+
LoyaltyType["FkVip"] = "FkVip";
|
|
573
|
+
LoyaltyType["FkPremium"] = "FkPremium";
|
|
574
|
+
LoyaltyType["InsiderIcon"] = "InsiderIcon";
|
|
575
|
+
LoyaltyType["InsiderElite"] = "InsiderElite";
|
|
418
576
|
})(LoyaltyType || (LoyaltyType = {}));
|
|
419
|
-
var LOYALTY_DATA = (_a = {},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
577
|
+
var LOYALTY_DATA = (_a = {}, _a[LoyaltyType.FkVip] = {
|
|
578
|
+
icon: jsxRuntime.jsx(ctDesignIcons.FkVip, {}),
|
|
579
|
+
borderGradient: 'linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)',
|
|
580
|
+
backgroundGradient: 'linear-gradient(111deg, #360042 0%, #540061 100%)'
|
|
581
|
+
}, _a[LoyaltyType.FkPremium] = {
|
|
582
|
+
icon: jsxRuntime.jsx(ctDesignIcons.FkPremium, {}),
|
|
583
|
+
borderGradient: 'linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)',
|
|
584
|
+
backgroundGradient: 'linear-gradient(180deg, #04176A 0%, #082395 100%)'
|
|
585
|
+
}, _a[LoyaltyType.InsiderIcon] = {
|
|
586
|
+
icon: jsxRuntime.jsx(ctDesignIcons.InsiderIcon, {}),
|
|
587
|
+
borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
|
|
588
|
+
backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)'
|
|
589
|
+
}, _a[LoyaltyType.InsiderElite] = {
|
|
590
|
+
icon: jsxRuntime.jsx(ctDesignIcons.InsiderElite, {}),
|
|
591
|
+
borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
|
|
592
|
+
backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)'
|
|
593
|
+
}, _a);
|
|
594
|
+
|
|
595
|
+
var ExpandableItem = function (_a) {
|
|
596
|
+
var icon = _a.icon,
|
|
597
|
+
handleChipClick = _a.handleChipClick,
|
|
598
|
+
value = _a.value;
|
|
599
|
+
var _b = react.useState(false),
|
|
600
|
+
isHovered = _b[0],
|
|
601
|
+
setIsHovered = _b[1];
|
|
602
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
603
|
+
className: "flex flex-middle justify-center br-8 c-pointer",
|
|
604
|
+
style: {
|
|
605
|
+
height: 32,
|
|
606
|
+
paddingLeft: 8,
|
|
607
|
+
paddingRight: isHovered ? 4 : 8,
|
|
608
|
+
transition: 'padding-right 0.2s ease-in-out',
|
|
609
|
+
background: isHovered ? '#ffd7ca' : '#ffe6df'
|
|
429
610
|
},
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
|
|
433
|
-
backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)',
|
|
611
|
+
onMouseEnter: function () {
|
|
612
|
+
return setIsHovered(true);
|
|
434
613
|
},
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
|
|
438
|
-
backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)',
|
|
614
|
+
onMouseLeave: function () {
|
|
615
|
+
return setIsHovered(false);
|
|
439
616
|
},
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
617
|
+
onClick: handleChipClick
|
|
618
|
+
}, {
|
|
619
|
+
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
620
|
+
className: 'flex flex-middle flex-gap-1'
|
|
621
|
+
}, {
|
|
622
|
+
children: [icon, value && jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
623
|
+
variant: 'B3',
|
|
624
|
+
className: 'value-text',
|
|
625
|
+
isClickable: true
|
|
626
|
+
}, {
|
|
627
|
+
children: value
|
|
628
|
+
}))]
|
|
629
|
+
})), jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
630
|
+
className: 'flex flex-middle o-hidden',
|
|
631
|
+
style: {
|
|
632
|
+
maxWidth: isHovered ? 16 : 0,
|
|
633
|
+
transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
|
|
634
|
+
opacity: isHovered ? 1 : 0
|
|
635
|
+
}
|
|
636
|
+
}, {
|
|
637
|
+
children: jsxRuntime.jsx(ctDesignIcons.HeaderChevronRight, {})
|
|
638
|
+
}))]
|
|
639
|
+
}));
|
|
456
640
|
};
|
|
457
641
|
var RewardsSection = function (props) {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
642
|
+
var selectedLoyaltyType = props.loyaltyType,
|
|
643
|
+
_a = props.fkSupercoinBurnBalance,
|
|
644
|
+
superCoinBalance = _a === void 0 ? 0 : _a,
|
|
645
|
+
_b = props.walletBalance,
|
|
646
|
+
walletBalance = _b === void 0 ? 0 : _b,
|
|
647
|
+
loyaltyLoading = props.loyaltyLoading,
|
|
648
|
+
superCoinsLoading = props.superCoinsLoading,
|
|
649
|
+
walletLoading = props.walletLoading,
|
|
650
|
+
walletChipClick = props.walletChipClick,
|
|
651
|
+
supercoinsChipClick = props.supercoinsChipClick,
|
|
652
|
+
loyaltyChipClick = props.loyaltyChipClick;
|
|
653
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
654
|
+
className: 'flex p-4 pt-0 flex-start flex-gap-1',
|
|
655
|
+
style: {
|
|
656
|
+
alignSelf: 'stretch'
|
|
657
|
+
}
|
|
658
|
+
}, {
|
|
659
|
+
children: [loyaltyLoading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
|
|
660
|
+
width: '50px',
|
|
661
|
+
height: '32px',
|
|
662
|
+
borderRadius: '8px'
|
|
663
|
+
}) : selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && jsxRuntime.jsx(LoyaltyChip, {
|
|
664
|
+
icon: LOYALTY_DATA[selectedLoyaltyType].icon,
|
|
665
|
+
borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient,
|
|
666
|
+
backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient,
|
|
667
|
+
handleChipClick: loyaltyChipClick
|
|
668
|
+
}), superCoinsLoading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
|
|
669
|
+
width: '50px',
|
|
670
|
+
height: '32px',
|
|
671
|
+
borderRadius: '8px'
|
|
672
|
+
}) : jsxRuntime.jsx(ExpandableItem, {
|
|
673
|
+
icon: jsxRuntime.jsx(ctDesignIcons.Supercoin, {
|
|
674
|
+
width: 20,
|
|
675
|
+
height: 20
|
|
676
|
+
}),
|
|
677
|
+
value: superCoinBalance,
|
|
678
|
+
handleChipClick: supercoinsChipClick
|
|
679
|
+
}), walletLoading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
|
|
680
|
+
width: '50px',
|
|
681
|
+
height: '32px',
|
|
682
|
+
borderRadius: '8px'
|
|
683
|
+
}) : jsxRuntime.jsx(ExpandableItem, {
|
|
684
|
+
icon: jsxRuntime.jsx(ctDesignIcons.Wallet, {
|
|
685
|
+
width: 20,
|
|
686
|
+
height: 20
|
|
687
|
+
}),
|
|
688
|
+
value: walletBalance,
|
|
689
|
+
handleChipClick: walletChipClick
|
|
690
|
+
})]
|
|
691
|
+
}));
|
|
461
692
|
};
|
|
462
693
|
|
|
694
|
+
var HoverableContainer = /*#__PURE__*/styled__default.default(ctDesignContainer.Container).withConfig({
|
|
695
|
+
displayName: "StyledHeader__HoverableContainer",
|
|
696
|
+
componentId: "sc-aht4pl-0"
|
|
697
|
+
})(templateObject_1 || (templateObject_1 = tslib.__makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #ecf3ff;\n color: green;\n }\n"], ["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #ecf3ff;\n color: green;\n }\n"])));
|
|
698
|
+
var LogoutButton = /*#__PURE__*/styled__default.default(ctDesignContainer.Container).withConfig({
|
|
699
|
+
displayName: "StyledHeader__LogoutButton",
|
|
700
|
+
componentId: "sc-aht4pl-1"
|
|
701
|
+
})(templateObject_2 || (templateObject_2 = tslib.__makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n column-gap: 8px;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #fbefef;\n }\n"], ["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n column-gap: 8px;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #fbefef;\n }\n"])));
|
|
702
|
+
var templateObject_1, templateObject_2;
|
|
703
|
+
|
|
463
704
|
var AccountDropdownContent = function (props) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
705
|
+
var _a = props || {},
|
|
706
|
+
handleLogout = _a.handleLogout,
|
|
707
|
+
userName = _a.userName,
|
|
708
|
+
userMobileNumber = _a.userMobileNumber,
|
|
709
|
+
countryCode = _a.countryCode,
|
|
710
|
+
userDetailsLoading = _a.userDetailsLoading,
|
|
711
|
+
superCoinBalance = _a.fkSupercoinBurnBalance,
|
|
712
|
+
walletBalance = _a.walletBalance,
|
|
713
|
+
loyaltyType = _a.loyaltyType,
|
|
714
|
+
loyaltyLoading = _a.loyaltyLoading,
|
|
715
|
+
walletLoading = _a.walletLoading,
|
|
716
|
+
superCoinsLoading = _a.superCoinsLoading,
|
|
717
|
+
walletChipClick = _a.walletChipClick,
|
|
718
|
+
supercoinsChipClick = _a.supercoinsChipClick,
|
|
719
|
+
loyaltyChipClick = _a.loyaltyChipClick,
|
|
720
|
+
isOpen = _a.isOpen;
|
|
721
|
+
var containerRef = useDropdownAnimation(isOpen).containerRef;
|
|
722
|
+
var _b = react.useMemo(function () {
|
|
723
|
+
var userGreeting = userName && "Hello ".concat(userName, "!");
|
|
724
|
+
var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
|
|
725
|
+
return {
|
|
726
|
+
userGreeting: userGreeting,
|
|
727
|
+
phoneNumber: phoneNumber
|
|
728
|
+
};
|
|
729
|
+
}, [userName, userMobileNumber, countryCode]),
|
|
730
|
+
userGreeting = _b.userGreeting,
|
|
731
|
+
phoneNumber = _b.phoneNumber;
|
|
732
|
+
var handleRedirectClick = function (redirectLink) {
|
|
733
|
+
return function () {
|
|
734
|
+
window.location.href = redirectLink;
|
|
475
735
|
};
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
positionAccountOptionsDiv();
|
|
486
|
-
}, []);
|
|
487
|
-
var renderUserData = function () {
|
|
488
|
-
var renderContent = function (loading, content, variant, color) { return (jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({ variant: variant, color: color }, { children: loading ? (jsxRuntime.jsx(ctDesignShimmer.Shimmer, { height: variant === 'HM3' ? '18px' : '12px', width: variant === 'HM3' ? '140px' : '200px' })) : (content) }))); };
|
|
489
|
-
return (jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({ className: 'flex flex-column flex-gap-1' }, { children: userGreeting ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderContent(userDetailsLoading, LOGGEDIN_USER_TEXT, 'P3', 'subheading'), renderContent(userDetailsLoading, phoneNumber, 'HM3', 'primary')] })) })));
|
|
736
|
+
};
|
|
737
|
+
react.useEffect(function () {
|
|
738
|
+
var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
|
|
739
|
+
var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
|
|
740
|
+
var positionAccountOptionsDiv = function () {
|
|
741
|
+
var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
|
|
742
|
+
if (accountOptionsElem && headerBtnRight) {
|
|
743
|
+
accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
|
|
744
|
+
}
|
|
490
745
|
};
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
746
|
+
positionAccountOptionsDiv();
|
|
747
|
+
}, []);
|
|
748
|
+
var renderUserData = function () {
|
|
749
|
+
var renderContent = function (loading, content, variant, color) {
|
|
750
|
+
return jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
751
|
+
variant: variant,
|
|
752
|
+
color: color
|
|
753
|
+
}, {
|
|
754
|
+
children: loading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
|
|
755
|
+
height: variant === 'HM3' ? '18px' : '12px',
|
|
756
|
+
width: variant === 'HM3' ? '140px' : '200px'
|
|
757
|
+
}) : content
|
|
758
|
+
}));
|
|
759
|
+
};
|
|
760
|
+
return jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
761
|
+
className: 'flex flex-column flex-gap-1'
|
|
762
|
+
}, {
|
|
763
|
+
children: userGreeting ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
764
|
+
children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')]
|
|
765
|
+
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
766
|
+
children: [renderContent(userDetailsLoading, LOGGEDIN_USER_TEXT, 'P3', 'subheading'), renderContent(userDetailsLoading, phoneNumber, 'HM3', 'primary')]
|
|
767
|
+
})
|
|
768
|
+
}));
|
|
769
|
+
};
|
|
770
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
771
|
+
id: ACCOUNT_OPTIONS_CONTAINER_ID,
|
|
772
|
+
ref: containerRef,
|
|
773
|
+
className: 'flex flex-column br-16 o-hidden',
|
|
774
|
+
css: {
|
|
775
|
+
zIndex: 1002,
|
|
776
|
+
opacity: 0,
|
|
777
|
+
top: '76px',
|
|
778
|
+
position: 'fixed'
|
|
779
|
+
},
|
|
780
|
+
width: "".concat(ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px"),
|
|
781
|
+
background: '#FFF1EC'
|
|
782
|
+
}, {
|
|
783
|
+
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
784
|
+
className: 'p-4',
|
|
785
|
+
height: '72px'
|
|
786
|
+
}, {
|
|
787
|
+
children: renderUserData()
|
|
788
|
+
})), jsxRuntime.jsx(RewardsSection, {
|
|
789
|
+
fkSupercoinBurnBalance: superCoinBalance,
|
|
790
|
+
walletBalance: walletBalance,
|
|
791
|
+
loyaltyType: loyaltyType,
|
|
792
|
+
loyaltyLoading: loyaltyLoading,
|
|
793
|
+
superCoinsLoading: superCoinsLoading,
|
|
794
|
+
walletLoading: walletLoading,
|
|
795
|
+
walletChipClick: walletChipClick,
|
|
796
|
+
supercoinsChipClick: supercoinsChipClick,
|
|
797
|
+
loyaltyChipClick: loyaltyChipClick
|
|
798
|
+
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
799
|
+
className: 'p-2 flex flex-column',
|
|
800
|
+
backgroundColor: 'white',
|
|
801
|
+
style: {
|
|
802
|
+
borderBottomLeftRadius: 12,
|
|
803
|
+
borderBottomRightRadius: 12,
|
|
804
|
+
rowGap: 8
|
|
805
|
+
}
|
|
806
|
+
}, {
|
|
807
|
+
children: [ACCOUNT_OPTIONS_POPUP_CONFIG.map(function (_a) {
|
|
808
|
+
var text = _a.text,
|
|
809
|
+
icon = _a.icon,
|
|
810
|
+
redirectionLink = _a.redirectionLink;
|
|
811
|
+
return jsxRuntime.jsx(HoverableContainer, tslib.__assign({
|
|
812
|
+
onClick: handleRedirectClick(redirectionLink)
|
|
813
|
+
}, {
|
|
814
|
+
children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
815
|
+
className: 'flex c-pointer',
|
|
816
|
+
style: {
|
|
817
|
+
columnGap: '8px'
|
|
818
|
+
}
|
|
819
|
+
}, {
|
|
820
|
+
children: [icon, jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
821
|
+
variant: 'P1',
|
|
822
|
+
className: 'flex flex-middle c-pointer'
|
|
823
|
+
}, {
|
|
824
|
+
children: text
|
|
825
|
+
}))]
|
|
826
|
+
}))
|
|
827
|
+
}), "account-option-".concat(text));
|
|
828
|
+
}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
829
|
+
style: {
|
|
830
|
+
borderBottom: '1px dashed #E6E6E6'
|
|
831
|
+
}
|
|
832
|
+
}), jsxRuntime.jsxs(LogoutButton, tslib.__assign({
|
|
833
|
+
onClick: handleLogout
|
|
834
|
+
}, {
|
|
835
|
+
children: [jsxRuntime.jsx(ctDesignIcons.Signout, {
|
|
836
|
+
height: 24,
|
|
837
|
+
width: 24
|
|
838
|
+
}), jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
839
|
+
variant: 'P1',
|
|
840
|
+
className: 'flex flex-middle c-pointer',
|
|
841
|
+
color: 'warning'
|
|
842
|
+
}, {
|
|
843
|
+
children: SIGN_OUT_TEXT
|
|
844
|
+
}))]
|
|
845
|
+
}))]
|
|
846
|
+
}))]
|
|
847
|
+
}));
|
|
501
848
|
};
|
|
502
849
|
|
|
503
850
|
var UserAccount = function (props) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
851
|
+
var handleLogout = props.handleLogout,
|
|
852
|
+
userDetailsLoading = props.userDetailsLoading,
|
|
853
|
+
userName = props.userName,
|
|
854
|
+
userMobileNumber = props.userMobileNumber,
|
|
855
|
+
countryCode = props.countryCode,
|
|
856
|
+
fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
|
|
857
|
+
walletBalance = props.walletBalance,
|
|
858
|
+
loyaltyType = props.loyaltyType,
|
|
859
|
+
walletLoading = props.walletLoading,
|
|
860
|
+
superCoinsLoading = props.superCoinsLoading,
|
|
861
|
+
loyaltyLoading = props.loyaltyLoading,
|
|
862
|
+
loyaltyChipClick = props.loyaltyChipClick,
|
|
863
|
+
supercoinsChipClick = props.supercoinsChipClick,
|
|
864
|
+
walletChipClick = props.walletChipClick;
|
|
865
|
+
var _a = useHoverDropdown({
|
|
866
|
+
openDelay: 500,
|
|
867
|
+
closeDelay: 50
|
|
868
|
+
}),
|
|
869
|
+
isDropdownVisible = _a.isDropdownVisible,
|
|
870
|
+
handleOnMouseEnter = _a.handleOnMouseEnter,
|
|
871
|
+
handleOnMouseLeave = _a.handleOnMouseLeave,
|
|
872
|
+
handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
|
|
873
|
+
handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
|
|
874
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
875
|
+
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
876
|
+
className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer",
|
|
877
|
+
style: {
|
|
878
|
+
columnGap: 8,
|
|
879
|
+
height: 64
|
|
880
|
+
},
|
|
881
|
+
onMouseEnter: function () {
|
|
882
|
+
return handleOnMouseEnter(4);
|
|
883
|
+
},
|
|
884
|
+
onMouseLeave: handleOnMouseLeave,
|
|
885
|
+
id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
|
|
886
|
+
}, {
|
|
887
|
+
children: [jsxRuntime.jsx(ctDesignIcons.MyAccount, {
|
|
888
|
+
color: isDropdownVisible ? '#FF4F17' : '#1A1A1A'
|
|
889
|
+
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
890
|
+
className: 'flex flex-row flex-middle'
|
|
891
|
+
}, {
|
|
892
|
+
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
893
|
+
variant: 'B2',
|
|
894
|
+
className: 'c-pointer',
|
|
895
|
+
color: isDropdownVisible ? 'secondary' : 'primary'
|
|
896
|
+
}, {
|
|
897
|
+
children: "My Account"
|
|
898
|
+
})), jsxRuntime.jsx(ctDesignIcons.ChevronDown, {
|
|
899
|
+
width: 20,
|
|
900
|
+
height: 20,
|
|
901
|
+
fill: isDropdownVisible ? '#FF4F17' : '#1A1A1A'
|
|
902
|
+
})]
|
|
903
|
+
}))]
|
|
904
|
+
})), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
905
|
+
show: isDropdownVisible,
|
|
906
|
+
marginTop: '64px',
|
|
907
|
+
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
908
|
+
handleDropdownMouseLeave: handleDropdownMouseLeave,
|
|
909
|
+
onMaskClick: handleDropdownMouseLeave
|
|
910
|
+
}, {
|
|
911
|
+
children: jsxRuntime.jsx(AccountDropdownContent, {
|
|
912
|
+
handleLogout: handleLogout,
|
|
913
|
+
userDetailsLoading: userDetailsLoading,
|
|
914
|
+
userName: userName,
|
|
915
|
+
userMobileNumber: userMobileNumber,
|
|
916
|
+
countryCode: countryCode,
|
|
917
|
+
loyaltyType: loyaltyType,
|
|
918
|
+
walletBalance: walletBalance,
|
|
919
|
+
fkSupercoinBurnBalance: fkSupercoinBurnBalance,
|
|
920
|
+
walletLoading: walletLoading,
|
|
921
|
+
superCoinsLoading: superCoinsLoading,
|
|
922
|
+
loyaltyLoading: loyaltyLoading,
|
|
923
|
+
loyaltyChipClick: loyaltyChipClick,
|
|
924
|
+
walletChipClick: walletChipClick,
|
|
925
|
+
supercoinsChipClick: supercoinsChipClick,
|
|
926
|
+
isOpen: isDropdownVisible
|
|
927
|
+
})
|
|
928
|
+
}))]
|
|
929
|
+
});
|
|
507
930
|
};
|
|
508
931
|
|
|
509
932
|
var Header = function (props) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
933
|
+
var superCoinsLoading = props.superCoinsLoading,
|
|
934
|
+
fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
|
|
935
|
+
onLoginButtonClick = props.onLoginButtonClick,
|
|
936
|
+
_a = props.showAllLobs,
|
|
937
|
+
showAllLobs = _a === void 0 ? false : _a,
|
|
938
|
+
selectedLOB = props.selectedLOB,
|
|
939
|
+
isUserLoggedIn = props.isUserLoggedIn,
|
|
940
|
+
handleLogoutClick = props.handleLogoutClick,
|
|
941
|
+
walletBalance = props.walletBalance,
|
|
942
|
+
walletLoading = props.walletLoading,
|
|
943
|
+
loyaltyLoading = props.loyaltyLoading,
|
|
944
|
+
loyaltyType = props.loyaltyType,
|
|
945
|
+
userDetailsLoading = props.userDetailsLoading,
|
|
946
|
+
userName = props.userName,
|
|
947
|
+
userMobileNumber = props.userMobileNumber,
|
|
948
|
+
countryCode = props.countryCode,
|
|
949
|
+
loyaltyChipClick = props.loyaltyChipClick,
|
|
950
|
+
supercoinsChipClick = props.supercoinsChipClick,
|
|
951
|
+
walletChipClick = props.walletChipClick;
|
|
952
|
+
props.ravenPayload;
|
|
953
|
+
props.ravenPushCallback;
|
|
954
|
+
var _c = useHoverDropdown({
|
|
955
|
+
openDelay: 500
|
|
956
|
+
}),
|
|
957
|
+
isDropdownVisible = _c.isDropdownVisible,
|
|
958
|
+
hoveredElemIndex = _c.hoveredElemIndex,
|
|
959
|
+
handleOnMouseEnter = _c.handleOnMouseEnter,
|
|
960
|
+
handleOnMouseLeave = _c.handleOnMouseLeave,
|
|
961
|
+
handleDropdownMouseEnter = _c.handleDropdownMouseEnter,
|
|
962
|
+
handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
|
|
963
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
964
|
+
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
965
|
+
className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink',
|
|
966
|
+
style: {
|
|
967
|
+
zIndex: 1000,
|
|
968
|
+
height: 64,
|
|
969
|
+
borderBottom: '1px solid #E6E6E6',
|
|
970
|
+
background: '#F7FAFF'
|
|
971
|
+
}
|
|
972
|
+
}, {
|
|
973
|
+
children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
974
|
+
className: 'flex flex-middle flex-between flex-gap-6',
|
|
975
|
+
style: {
|
|
976
|
+
maxWidth: 1440,
|
|
977
|
+
padding: '0px 28px',
|
|
978
|
+
flex: '1 0 0'
|
|
979
|
+
}
|
|
980
|
+
}, {
|
|
981
|
+
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
982
|
+
className: 'flex flex-row flex-center flex-middle'
|
|
983
|
+
}, {
|
|
984
|
+
children: [jsxRuntime.jsx(ctDesignIcons.CTLogo, {}), jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
985
|
+
style: {
|
|
986
|
+
width: 12,
|
|
987
|
+
marginLeft: 2,
|
|
988
|
+
marginRight: 2,
|
|
989
|
+
transform: 'rotate(90deg)',
|
|
990
|
+
borderBottom: '1px solid #e0e0e0'
|
|
991
|
+
}
|
|
992
|
+
}), jsxRuntime.jsx(ctDesignIcons.Fkcompany, {})]
|
|
993
|
+
})), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
994
|
+
className: 'flex flex-row flex-middle flex-center flex-cg-6'
|
|
995
|
+
}, {
|
|
996
|
+
children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
997
|
+
className: 'flex flex-row flex-middle flex-center flex-cg-1'
|
|
998
|
+
}, {
|
|
999
|
+
children: NAVBAR_OPTIONS.map(function (option, index) {
|
|
1000
|
+
var isHovered = hoveredElemIndex === index;
|
|
1001
|
+
return jsxRuntime.jsxs(ctDesignContainer.Container, {
|
|
1002
|
+
children: [jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1003
|
+
onMouseEnter: function () {
|
|
1004
|
+
return handleOnMouseEnter(index);
|
|
1005
|
+
},
|
|
1006
|
+
onMouseLeave: handleOnMouseLeave,
|
|
1007
|
+
className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative',
|
|
1008
|
+
style: {
|
|
1009
|
+
columnGap: 8,
|
|
1010
|
+
height: 64
|
|
1011
|
+
},
|
|
1012
|
+
onClick: function () {
|
|
1013
|
+
if (option.isClickable) {
|
|
1014
|
+
window.location.href = option.link;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}, {
|
|
1018
|
+
children: [jsxRuntime.jsx(option.lefticon, {
|
|
1019
|
+
color: isHovered ? '#FF4F17' : '#1A1A1A'
|
|
1020
|
+
}), jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({
|
|
1021
|
+
className: 'flex flex-row flex-middle'
|
|
1022
|
+
}, {
|
|
1023
|
+
children: [jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1024
|
+
variant: 'B2',
|
|
1025
|
+
color: isHovered ? 'secondary' : 'primary',
|
|
1026
|
+
isClickable: true
|
|
1027
|
+
}, {
|
|
1028
|
+
children: option.text
|
|
1029
|
+
})), option.rightIcon && jsxRuntime.jsx(option.rightIcon, {
|
|
1030
|
+
width: 20,
|
|
1031
|
+
height: 20,
|
|
1032
|
+
fill: isHovered ? '#FF4F17' : '#1A1A1A'
|
|
1033
|
+
})]
|
|
1034
|
+
}))]
|
|
1035
|
+
}), "nav-option-".concat(index)), jsxRuntime.jsx(HeaderAnimatedMask, tslib.__assign({
|
|
1036
|
+
show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible,
|
|
1037
|
+
marginTop: '64px',
|
|
1038
|
+
handleDropdownMouseEnter: handleDropdownMouseEnter,
|
|
1039
|
+
handleDropdownMouseLeave: handleDropdownMouseLeave,
|
|
1040
|
+
onMaskClick: handleDropdownMouseLeave
|
|
1041
|
+
}, {
|
|
1042
|
+
children: jsxRuntime.jsx(BusinessDropdownContent, {
|
|
1043
|
+
isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible
|
|
1044
|
+
})
|
|
1045
|
+
}))]
|
|
1046
|
+
});
|
|
1047
|
+
})
|
|
1048
|
+
})), isUserLoggedIn && jsxRuntime.jsx(ctDesignDivider.Divider, {
|
|
1049
|
+
style: {
|
|
1050
|
+
width: 12,
|
|
1051
|
+
margin: '0 -18px',
|
|
1052
|
+
transform: 'rotate(90deg)',
|
|
1053
|
+
borderBottom: '1px solid #e0e0e0'
|
|
1054
|
+
}
|
|
1055
|
+
}), jsxRuntime.jsx(ctDesignContainer.Container, {
|
|
1056
|
+
children: isUserLoggedIn ? jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({
|
|
1057
|
+
className: 'flex flex-row flex-middle'
|
|
1058
|
+
}, {
|
|
1059
|
+
children: jsxRuntime.jsx(UserAccount, {
|
|
1060
|
+
handleLogout: handleLogoutClick,
|
|
1061
|
+
superCoinsLoading: superCoinsLoading,
|
|
1062
|
+
fkSupercoinBurnBalance: fkSupercoinBurnBalance,
|
|
1063
|
+
walletBalance: walletBalance,
|
|
1064
|
+
walletLoading: walletLoading,
|
|
1065
|
+
loyaltyLoading: loyaltyLoading,
|
|
1066
|
+
loyaltyType: loyaltyType,
|
|
1067
|
+
userDetailsLoading: userDetailsLoading,
|
|
1068
|
+
userName: userName,
|
|
1069
|
+
userMobileNumber: userMobileNumber,
|
|
1070
|
+
countryCode: countryCode,
|
|
1071
|
+
walletChipClick: walletChipClick,
|
|
1072
|
+
supercoinsChipClick: supercoinsChipClick,
|
|
1073
|
+
loyaltyChipClick: loyaltyChipClick
|
|
1074
|
+
})
|
|
1075
|
+
})) : jsxRuntime.jsx(ctDesignButton.Button, tslib.__assign({
|
|
1076
|
+
className: "fw-400 fs-14 login-button",
|
|
1077
|
+
onClick: onLoginButtonClick,
|
|
1078
|
+
style: {
|
|
1079
|
+
width: 153,
|
|
1080
|
+
height: 40,
|
|
1081
|
+
border: '1px solid #1A1A1A'
|
|
1082
|
+
},
|
|
1083
|
+
loading: false
|
|
1084
|
+
}, {
|
|
1085
|
+
children: jsxRuntime.jsx(ctDesignTypography.Typography, tslib.__assign({
|
|
1086
|
+
componentNode: 'span',
|
|
1087
|
+
variant: 'L2'
|
|
1088
|
+
}, {
|
|
1089
|
+
children: "Login"
|
|
1090
|
+
}))
|
|
1091
|
+
}))
|
|
1092
|
+
})]
|
|
1093
|
+
}))]
|
|
1094
|
+
}))
|
|
1095
|
+
})), showAllLobs && jsxRuntime.jsx(LobsHeader, {
|
|
1096
|
+
selectedLOB: selectedLOB
|
|
1097
|
+
})]
|
|
1098
|
+
});
|
|
546
1099
|
};
|
|
547
1100
|
|
|
548
1101
|
exports.Header = Header;
|