@bonlineza/luxity-lib 2.34.8 → 2.35.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/GraphQLDropdownSelector.js +54 -27
- package/Interests.js +54 -27
- package/LuxityDesktopHeader.js +21 -13
- package/LuxityGraphQLDropdownSelector.js +54 -27
- package/LuxityMobileHeader.js +13 -12
- package/MaterialSelector.js +54 -27
- package/ModelSelector.js +54 -27
- package/NotificationDropDown.js +54 -27
- package/build/CountryCodeSelect/index.js +18 -0
- package/build/ReactSelectWrapper/index.js +34 -0
- package/build/bundle.css +1 -1
- package/build/bundle.js +88 -52
- package/package.json +1 -1
|
@@ -9251,7 +9251,7 @@
|
|
|
9251
9251
|
});
|
|
9252
9252
|
|
|
9253
9253
|
var _templateObject$E;
|
|
9254
|
-
var NotifyContainer = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width:
|
|
9254
|
+
var NotifyContainer = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .notification-settings {\n display: flex;\n align-items: center;\n }\n\n .notification-dropdown-label {\n margin-left: 20px;\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width: 110px;\n\n .notification-dropdown-select__control {\n min-height: auto;\n background-color: ", ";\n border: none;\n border-radius: 0;\n\n &--is-focused {\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n\n .notification-dropdown-select__value-container {\n & > div {\n padding: 0;\n margin: 0;\n color: ", ";\n }\n & .notification-dropdown-select__single-value,\n & .notification-dropdown-select__placeholder {\n overflow: visible;\n font-weight: lighter;\n }\n }\n }\n }\n\n .notification-dropdown-select__indicators {\n padding: 0 !important;\n .notification-dropdown-select__dropdown-indicator {\n color: ", ";\n }\n }\n\n .notification-dropdown-select__menu {\n border-radius: 0;\n\n & > .notification-dropdown-select__menu-list {\n border-radius: 0;\n\n & > .notification-dropdown-select__option {\n font-weight: bold;\n &:last-child {\n border-bottom: none;\n }\n\n &.notification-dropdown-select__option--is-focused {\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected {\n color: ", ";\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected.notification-dropdown-select__option--is-focused {\n border-style: hidden;\n }\n }\n }\n }\n"])), function (props) {
|
|
9255
9255
|
return props.theme.colors.ntrlMin;
|
|
9256
9256
|
}, function (props) {
|
|
9257
9257
|
return props.theme.colors.base;
|
|
@@ -9292,22 +9292,21 @@
|
|
|
9292
9292
|
|
|
9293
9293
|
_this = _super.call(this, props);
|
|
9294
9294
|
|
|
9295
|
-
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption) {
|
|
9295
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
9296
9296
|
_this.setState({
|
|
9297
9297
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9298
9298
|
fetching: true
|
|
9299
9299
|
})
|
|
9300
9300
|
});
|
|
9301
9301
|
|
|
9302
|
-
_this.props.setSchedule(selectedOption.value).then(function () {
|
|
9303
|
-
_this
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
});
|
|
9302
|
+
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
9303
|
+
var _this$setState;
|
|
9304
|
+
|
|
9305
|
+
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9306
|
+
success: true
|
|
9307
|
+
})), _this$setState));
|
|
9309
9308
|
|
|
9310
|
-
success('Notification Frequency Updated
|
|
9309
|
+
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
9311
9310
|
}).catch(function () {
|
|
9312
9311
|
_this.setState({
|
|
9313
9312
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
@@ -9315,7 +9314,7 @@
|
|
|
9315
9314
|
})
|
|
9316
9315
|
});
|
|
9317
9316
|
|
|
9318
|
-
error('Error
|
|
9317
|
+
error('Error Occurred');
|
|
9319
9318
|
});
|
|
9320
9319
|
});
|
|
9321
9320
|
|
|
@@ -9334,24 +9333,29 @@
|
|
|
9334
9333
|
|
|
9335
9334
|
var options = _this.getOptionsFromEnumResult(data);
|
|
9336
9335
|
|
|
9337
|
-
var
|
|
9336
|
+
var _data$data$user = data.data.user,
|
|
9337
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
9338
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
9339
|
+
vip = _data$data$user.vip;
|
|
9338
9340
|
|
|
9339
|
-
_this.setState(
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
}
|
|
9341
|
+
_this.setState({
|
|
9342
|
+
options: options,
|
|
9343
|
+
isVip: vip,
|
|
9344
|
+
emailSelectedOption: options.find(function (item) {
|
|
9345
|
+
return item.value === email_interest_send_schedule;
|
|
9346
|
+
}),
|
|
9347
|
+
whatsappSelectedOption: options.find(function (item) {
|
|
9348
|
+
return item.value === whatsapp_interest_send_schedule;
|
|
9349
|
+
})
|
|
9348
9350
|
});
|
|
9349
9351
|
});
|
|
9350
9352
|
|
|
9351
9353
|
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9352
9354
|
var _this$state = _this.state,
|
|
9353
9355
|
options = _this$state.options,
|
|
9354
|
-
|
|
9356
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
9357
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
9358
|
+
isVip = _this$state.isVip,
|
|
9355
9359
|
updating = _this$state.request.fetching;
|
|
9356
9360
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9357
9361
|
getRequestPromise: _this.props.getSchedule,
|
|
@@ -9359,8 +9363,10 @@
|
|
|
9359
9363
|
return _this.onData(data);
|
|
9360
9364
|
}
|
|
9361
9365
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9366
|
+
className: "notification-settings"
|
|
9367
|
+
}, isVip && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9362
9368
|
className: "notification-dropdown-label"
|
|
9363
|
-
}, "
|
|
9369
|
+
}, "Notify me via WhatsApp:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
9364
9370
|
isMulti: false,
|
|
9365
9371
|
isSearchable: false,
|
|
9366
9372
|
components: {
|
|
@@ -9371,14 +9377,35 @@
|
|
|
9371
9377
|
options: options,
|
|
9372
9378
|
className: "notification-dropdown-select-container",
|
|
9373
9379
|
classNamePrefix: "notification-dropdown-select",
|
|
9374
|
-
onChange:
|
|
9375
|
-
|
|
9376
|
-
|
|
9380
|
+
onChange: function onChange(option) {
|
|
9381
|
+
return _this.postUpdate(option, 'WHATSAPP');
|
|
9382
|
+
},
|
|
9383
|
+
value: whatsappSelectedOption
|
|
9384
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9385
|
+
className: "notification-dropdown-label"
|
|
9386
|
+
}, "Notify me via Email:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
9387
|
+
isMulti: false,
|
|
9388
|
+
isSearchable: false,
|
|
9389
|
+
components: {
|
|
9390
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
9391
|
+
return null;
|
|
9392
|
+
}
|
|
9393
|
+
},
|
|
9394
|
+
options: options,
|
|
9395
|
+
className: "notification-dropdown-select-container",
|
|
9396
|
+
classNamePrefix: "notification-dropdown-select",
|
|
9397
|
+
onChange: function onChange(option) {
|
|
9398
|
+
return _this.postUpdate(option, 'EMAIL');
|
|
9399
|
+
},
|
|
9400
|
+
value: emailSelectedOption
|
|
9401
|
+
})))));
|
|
9377
9402
|
});
|
|
9378
9403
|
|
|
9379
9404
|
_this.state = {
|
|
9380
9405
|
options: [],
|
|
9381
|
-
|
|
9406
|
+
emailSelectedOption: null,
|
|
9407
|
+
whatsappSelectedOption: null,
|
|
9408
|
+
isVip: false,
|
|
9382
9409
|
request: _objectSpread2({}, request)
|
|
9383
9410
|
};
|
|
9384
9411
|
return _this;
|
package/Interests.js
CHANGED
|
@@ -7143,7 +7143,7 @@
|
|
|
7143
7143
|
var index$1 = manageState(Select);
|
|
7144
7144
|
|
|
7145
7145
|
var _templateObject$1;
|
|
7146
|
-
var NotifyContainer = styled__default.div(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width:
|
|
7146
|
+
var NotifyContainer = styled__default.div(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .notification-settings {\n display: flex;\n align-items: center;\n }\n\n .notification-dropdown-label {\n margin-left: 20px;\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width: 110px;\n\n .notification-dropdown-select__control {\n min-height: auto;\n background-color: ", ";\n border: none;\n border-radius: 0;\n\n &--is-focused {\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n\n .notification-dropdown-select__value-container {\n & > div {\n padding: 0;\n margin: 0;\n color: ", ";\n }\n & .notification-dropdown-select__single-value,\n & .notification-dropdown-select__placeholder {\n overflow: visible;\n font-weight: lighter;\n }\n }\n }\n }\n\n .notification-dropdown-select__indicators {\n padding: 0 !important;\n .notification-dropdown-select__dropdown-indicator {\n color: ", ";\n }\n }\n\n .notification-dropdown-select__menu {\n border-radius: 0;\n\n & > .notification-dropdown-select__menu-list {\n border-radius: 0;\n\n & > .notification-dropdown-select__option {\n font-weight: bold;\n &:last-child {\n border-bottom: none;\n }\n\n &.notification-dropdown-select__option--is-focused {\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected {\n color: ", ";\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected.notification-dropdown-select__option--is-focused {\n border-style: hidden;\n }\n }\n }\n }\n"])), function (props) {
|
|
7147
7147
|
return props.theme.colors.ntrlMin;
|
|
7148
7148
|
}, function (props) {
|
|
7149
7149
|
return props.theme.colors.base;
|
|
@@ -7197,22 +7197,21 @@
|
|
|
7197
7197
|
|
|
7198
7198
|
_this = _super.call(this, props);
|
|
7199
7199
|
|
|
7200
|
-
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption) {
|
|
7200
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
7201
7201
|
_this.setState({
|
|
7202
7202
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7203
7203
|
fetching: true
|
|
7204
7204
|
})
|
|
7205
7205
|
});
|
|
7206
7206
|
|
|
7207
|
-
_this.props.setSchedule(selectedOption.value).then(function () {
|
|
7208
|
-
_this
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
});
|
|
7207
|
+
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
7208
|
+
var _this$setState;
|
|
7209
|
+
|
|
7210
|
+
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7211
|
+
success: true
|
|
7212
|
+
})), _this$setState));
|
|
7214
7213
|
|
|
7215
|
-
success('Notification Frequency Updated
|
|
7214
|
+
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
7216
7215
|
}).catch(function () {
|
|
7217
7216
|
_this.setState({
|
|
7218
7217
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
@@ -7220,7 +7219,7 @@
|
|
|
7220
7219
|
})
|
|
7221
7220
|
});
|
|
7222
7221
|
|
|
7223
|
-
error('Error
|
|
7222
|
+
error('Error Occurred');
|
|
7224
7223
|
});
|
|
7225
7224
|
});
|
|
7226
7225
|
|
|
@@ -7239,24 +7238,29 @@
|
|
|
7239
7238
|
|
|
7240
7239
|
var options = _this.getOptionsFromEnumResult(data);
|
|
7241
7240
|
|
|
7242
|
-
var
|
|
7241
|
+
var _data$data$user = data.data.user,
|
|
7242
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
7243
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
7244
|
+
vip = _data$data$user.vip;
|
|
7243
7245
|
|
|
7244
|
-
_this.setState(
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
}
|
|
7246
|
+
_this.setState({
|
|
7247
|
+
options: options,
|
|
7248
|
+
isVip: vip,
|
|
7249
|
+
emailSelectedOption: options.find(function (item) {
|
|
7250
|
+
return item.value === email_interest_send_schedule;
|
|
7251
|
+
}),
|
|
7252
|
+
whatsappSelectedOption: options.find(function (item) {
|
|
7253
|
+
return item.value === whatsapp_interest_send_schedule;
|
|
7254
|
+
})
|
|
7253
7255
|
});
|
|
7254
7256
|
});
|
|
7255
7257
|
|
|
7256
7258
|
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7257
7259
|
var _this$state = _this.state,
|
|
7258
7260
|
options = _this$state.options,
|
|
7259
|
-
|
|
7261
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
7262
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
7263
|
+
isVip = _this$state.isVip,
|
|
7260
7264
|
updating = _this$state.request.fetching;
|
|
7261
7265
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
7262
7266
|
getRequestPromise: _this.props.getSchedule,
|
|
@@ -7264,8 +7268,10 @@
|
|
|
7264
7268
|
return _this.onData(data);
|
|
7265
7269
|
}
|
|
7266
7270
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
7271
|
+
className: "notification-settings"
|
|
7272
|
+
}, isVip && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
7267
7273
|
className: "notification-dropdown-label"
|
|
7268
|
-
}, "
|
|
7274
|
+
}, "Notify me via WhatsApp:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
7269
7275
|
isMulti: false,
|
|
7270
7276
|
isSearchable: false,
|
|
7271
7277
|
components: {
|
|
@@ -7276,14 +7282,35 @@
|
|
|
7276
7282
|
options: options,
|
|
7277
7283
|
className: "notification-dropdown-select-container",
|
|
7278
7284
|
classNamePrefix: "notification-dropdown-select",
|
|
7279
|
-
onChange:
|
|
7280
|
-
|
|
7281
|
-
|
|
7285
|
+
onChange: function onChange(option) {
|
|
7286
|
+
return _this.postUpdate(option, 'WHATSAPP');
|
|
7287
|
+
},
|
|
7288
|
+
value: whatsappSelectedOption
|
|
7289
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
7290
|
+
className: "notification-dropdown-label"
|
|
7291
|
+
}, "Notify me via Email:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
7292
|
+
isMulti: false,
|
|
7293
|
+
isSearchable: false,
|
|
7294
|
+
components: {
|
|
7295
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
7296
|
+
return null;
|
|
7297
|
+
}
|
|
7298
|
+
},
|
|
7299
|
+
options: options,
|
|
7300
|
+
className: "notification-dropdown-select-container",
|
|
7301
|
+
classNamePrefix: "notification-dropdown-select",
|
|
7302
|
+
onChange: function onChange(option) {
|
|
7303
|
+
return _this.postUpdate(option, 'EMAIL');
|
|
7304
|
+
},
|
|
7305
|
+
value: emailSelectedOption
|
|
7306
|
+
})))));
|
|
7282
7307
|
});
|
|
7283
7308
|
|
|
7284
7309
|
_this.state = {
|
|
7285
7310
|
options: [],
|
|
7286
|
-
|
|
7311
|
+
emailSelectedOption: null,
|
|
7312
|
+
whatsappSelectedOption: null,
|
|
7313
|
+
isVip: false,
|
|
7287
7314
|
request: _objectSpread2({}, request)
|
|
7288
7315
|
};
|
|
7289
7316
|
return _this;
|
package/LuxityDesktopHeader.js
CHANGED
|
@@ -824,27 +824,24 @@
|
|
|
824
824
|
};
|
|
825
825
|
|
|
826
826
|
var debouncedSearch = React.useCallback(debounce(function (nextValue) {
|
|
827
|
-
var isKeyDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
828
827
|
setSearchLoading(true);
|
|
829
828
|
axios.post(endpoint, searchProducts(nextValue, 6)).then(function (response) {
|
|
830
829
|
setSearchResults(response.data.data.luxity_products_serach_results);
|
|
831
830
|
var ids = response.data.data.luxity_products_serach_results.luxity_product_ids;
|
|
832
831
|
onProductIdsReceived(ids);
|
|
833
|
-
|
|
834
|
-
if (isKeyDown) {
|
|
835
|
-
// reset the search results on keydown
|
|
836
|
-
setSearchResults({
|
|
837
|
-
brands: [],
|
|
838
|
-
products: []
|
|
839
|
-
});
|
|
840
|
-
onSearchSubmit(nextValue);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
832
|
setSearchLoading(false);
|
|
844
833
|
}).catch(function () {
|
|
845
834
|
setSearchLoading(false);
|
|
846
835
|
});
|
|
847
836
|
}, 500), [endpoint]);
|
|
837
|
+
var immediateSearch = React.useCallback(function (value) {
|
|
838
|
+
setSearchValue('');
|
|
839
|
+
setSearchResults({
|
|
840
|
+
brands: [],
|
|
841
|
+
products: []
|
|
842
|
+
});
|
|
843
|
+
onSearchSubmit(value);
|
|
844
|
+
}, [onSearchSubmit]);
|
|
848
845
|
|
|
849
846
|
var handleChange = function handleChange(event) {
|
|
850
847
|
var value = event.target.value;
|
|
@@ -875,7 +872,11 @@
|
|
|
875
872
|
|
|
876
873
|
var handleKeyDown = function handleKeyDown(event) {
|
|
877
874
|
if (event.key === 'Enter') {
|
|
878
|
-
|
|
875
|
+
event.preventDefault();
|
|
876
|
+
|
|
877
|
+
if (searchValue.trim().length >= 3) {
|
|
878
|
+
immediateSearch(searchValue);
|
|
879
|
+
}
|
|
879
880
|
} else if (event.key === 'Escape') {
|
|
880
881
|
setSearchValue('');
|
|
881
882
|
}
|
|
@@ -910,6 +911,13 @@
|
|
|
910
911
|
return setHasError(true);
|
|
911
912
|
});
|
|
912
913
|
}, [menuData]);
|
|
914
|
+
|
|
915
|
+
var getMarginRight = function getMarginRight(userIsVip, userName) {
|
|
916
|
+
if (userIsVip) return '15px';
|
|
917
|
+
if (userName) return '5px';
|
|
918
|
+
return '18px';
|
|
919
|
+
};
|
|
920
|
+
|
|
913
921
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
914
922
|
className: "navbar"
|
|
915
923
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -1050,7 +1058,7 @@
|
|
|
1050
1058
|
className: "navbar__icon relative flex",
|
|
1051
1059
|
onClick: onAccountClick,
|
|
1052
1060
|
style: {
|
|
1053
|
-
marginRight: isVip
|
|
1061
|
+
marginRight: getMarginRight(isVip, name)
|
|
1054
1062
|
}
|
|
1055
1063
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
1056
1064
|
src: accountIcon,
|
|
@@ -9251,7 +9251,7 @@
|
|
|
9251
9251
|
});
|
|
9252
9252
|
|
|
9253
9253
|
var _templateObject$E;
|
|
9254
|
-
var NotifyContainer = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width:
|
|
9254
|
+
var NotifyContainer = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .notification-settings {\n display: flex;\n align-items: center;\n }\n\n .notification-dropdown-label {\n margin-left: 20px;\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width: 110px;\n\n .notification-dropdown-select__control {\n min-height: auto;\n background-color: ", ";\n border: none;\n border-radius: 0;\n\n &--is-focused {\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n\n .notification-dropdown-select__value-container {\n & > div {\n padding: 0;\n margin: 0;\n color: ", ";\n }\n & .notification-dropdown-select__single-value,\n & .notification-dropdown-select__placeholder {\n overflow: visible;\n font-weight: lighter;\n }\n }\n }\n }\n\n .notification-dropdown-select__indicators {\n padding: 0 !important;\n .notification-dropdown-select__dropdown-indicator {\n color: ", ";\n }\n }\n\n .notification-dropdown-select__menu {\n border-radius: 0;\n\n & > .notification-dropdown-select__menu-list {\n border-radius: 0;\n\n & > .notification-dropdown-select__option {\n font-weight: bold;\n &:last-child {\n border-bottom: none;\n }\n\n &.notification-dropdown-select__option--is-focused {\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected {\n color: ", ";\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected.notification-dropdown-select__option--is-focused {\n border-style: hidden;\n }\n }\n }\n }\n"])), function (props) {
|
|
9255
9255
|
return props.theme.colors.ntrlMin;
|
|
9256
9256
|
}, function (props) {
|
|
9257
9257
|
return props.theme.colors.base;
|
|
@@ -9292,22 +9292,21 @@
|
|
|
9292
9292
|
|
|
9293
9293
|
_this = _super.call(this, props);
|
|
9294
9294
|
|
|
9295
|
-
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption) {
|
|
9295
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
9296
9296
|
_this.setState({
|
|
9297
9297
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9298
9298
|
fetching: true
|
|
9299
9299
|
})
|
|
9300
9300
|
});
|
|
9301
9301
|
|
|
9302
|
-
_this.props.setSchedule(selectedOption.value).then(function () {
|
|
9303
|
-
_this
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
});
|
|
9302
|
+
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
9303
|
+
var _this$setState;
|
|
9304
|
+
|
|
9305
|
+
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9306
|
+
success: true
|
|
9307
|
+
})), _this$setState));
|
|
9309
9308
|
|
|
9310
|
-
success('Notification Frequency Updated
|
|
9309
|
+
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
9311
9310
|
}).catch(function () {
|
|
9312
9311
|
_this.setState({
|
|
9313
9312
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
@@ -9315,7 +9314,7 @@
|
|
|
9315
9314
|
})
|
|
9316
9315
|
});
|
|
9317
9316
|
|
|
9318
|
-
error('Error
|
|
9317
|
+
error('Error Occurred');
|
|
9319
9318
|
});
|
|
9320
9319
|
});
|
|
9321
9320
|
|
|
@@ -9334,24 +9333,29 @@
|
|
|
9334
9333
|
|
|
9335
9334
|
var options = _this.getOptionsFromEnumResult(data);
|
|
9336
9335
|
|
|
9337
|
-
var
|
|
9336
|
+
var _data$data$user = data.data.user,
|
|
9337
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
9338
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
9339
|
+
vip = _data$data$user.vip;
|
|
9338
9340
|
|
|
9339
|
-
_this.setState(
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
}
|
|
9341
|
+
_this.setState({
|
|
9342
|
+
options: options,
|
|
9343
|
+
isVip: vip,
|
|
9344
|
+
emailSelectedOption: options.find(function (item) {
|
|
9345
|
+
return item.value === email_interest_send_schedule;
|
|
9346
|
+
}),
|
|
9347
|
+
whatsappSelectedOption: options.find(function (item) {
|
|
9348
|
+
return item.value === whatsapp_interest_send_schedule;
|
|
9349
|
+
})
|
|
9348
9350
|
});
|
|
9349
9351
|
});
|
|
9350
9352
|
|
|
9351
9353
|
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9352
9354
|
var _this$state = _this.state,
|
|
9353
9355
|
options = _this$state.options,
|
|
9354
|
-
|
|
9356
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
9357
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
9358
|
+
isVip = _this$state.isVip,
|
|
9355
9359
|
updating = _this$state.request.fetching;
|
|
9356
9360
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9357
9361
|
getRequestPromise: _this.props.getSchedule,
|
|
@@ -9359,8 +9363,10 @@
|
|
|
9359
9363
|
return _this.onData(data);
|
|
9360
9364
|
}
|
|
9361
9365
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9366
|
+
className: "notification-settings"
|
|
9367
|
+
}, isVip && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9362
9368
|
className: "notification-dropdown-label"
|
|
9363
|
-
}, "
|
|
9369
|
+
}, "Notify me via WhatsApp:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
9364
9370
|
isMulti: false,
|
|
9365
9371
|
isSearchable: false,
|
|
9366
9372
|
components: {
|
|
@@ -9371,14 +9377,35 @@
|
|
|
9371
9377
|
options: options,
|
|
9372
9378
|
className: "notification-dropdown-select-container",
|
|
9373
9379
|
classNamePrefix: "notification-dropdown-select",
|
|
9374
|
-
onChange:
|
|
9375
|
-
|
|
9376
|
-
|
|
9380
|
+
onChange: function onChange(option) {
|
|
9381
|
+
return _this.postUpdate(option, 'WHATSAPP');
|
|
9382
|
+
},
|
|
9383
|
+
value: whatsappSelectedOption
|
|
9384
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9385
|
+
className: "notification-dropdown-label"
|
|
9386
|
+
}, "Notify me via Email:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
9387
|
+
isMulti: false,
|
|
9388
|
+
isSearchable: false,
|
|
9389
|
+
components: {
|
|
9390
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
9391
|
+
return null;
|
|
9392
|
+
}
|
|
9393
|
+
},
|
|
9394
|
+
options: options,
|
|
9395
|
+
className: "notification-dropdown-select-container",
|
|
9396
|
+
classNamePrefix: "notification-dropdown-select",
|
|
9397
|
+
onChange: function onChange(option) {
|
|
9398
|
+
return _this.postUpdate(option, 'EMAIL');
|
|
9399
|
+
},
|
|
9400
|
+
value: emailSelectedOption
|
|
9401
|
+
})))));
|
|
9377
9402
|
});
|
|
9378
9403
|
|
|
9379
9404
|
_this.state = {
|
|
9380
9405
|
options: [],
|
|
9381
|
-
|
|
9406
|
+
emailSelectedOption: null,
|
|
9407
|
+
whatsappSelectedOption: null,
|
|
9408
|
+
isVip: false,
|
|
9382
9409
|
request: _objectSpread2({}, request)
|
|
9383
9410
|
};
|
|
9384
9411
|
return _this;
|
package/LuxityMobileHeader.js
CHANGED
|
@@ -1323,27 +1323,24 @@
|
|
|
1323
1323
|
};
|
|
1324
1324
|
|
|
1325
1325
|
var debouncedSearch = React.useCallback(debounce(function (nextValue) {
|
|
1326
|
-
var isKeyDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1327
1326
|
setSearchLoading(true);
|
|
1328
1327
|
axios.post(endpoint, searchProducts(nextValue, 6)).then(function (response) {
|
|
1329
1328
|
setSearchResults(response.data.data.luxity_products_serach_results);
|
|
1330
1329
|
var ids = response.data.data.luxity_products_serach_results.luxity_product_ids;
|
|
1331
1330
|
onProductIdsReceived(ids);
|
|
1332
|
-
|
|
1333
|
-
if (isKeyDown) {
|
|
1334
|
-
// reset the search results on keydown
|
|
1335
|
-
setSearchResults({
|
|
1336
|
-
brands: [],
|
|
1337
|
-
products: []
|
|
1338
|
-
});
|
|
1339
|
-
onSearchSubmit(nextValue);
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
1331
|
setSearchLoading(false);
|
|
1343
1332
|
}).catch(function () {
|
|
1344
1333
|
setSearchLoading(false);
|
|
1345
1334
|
});
|
|
1346
1335
|
}, 500), [endpoint]);
|
|
1336
|
+
var immediateSearch = React.useCallback(function (value) {
|
|
1337
|
+
setSearchValue('');
|
|
1338
|
+
setSearchResults({
|
|
1339
|
+
brands: [],
|
|
1340
|
+
products: []
|
|
1341
|
+
});
|
|
1342
|
+
onSearchSubmit(value);
|
|
1343
|
+
}, [onSearchSubmit]);
|
|
1347
1344
|
|
|
1348
1345
|
var handleChange = function handleChange(event) {
|
|
1349
1346
|
var value = event.target.value;
|
|
@@ -1361,7 +1358,11 @@
|
|
|
1361
1358
|
|
|
1362
1359
|
var handleKeyDown = function handleKeyDown(event) {
|
|
1363
1360
|
if (event.key === 'Enter') {
|
|
1364
|
-
|
|
1361
|
+
event.preventDefault();
|
|
1362
|
+
|
|
1363
|
+
if (searchValue.trim().length >= 3) {
|
|
1364
|
+
immediateSearch(searchValue);
|
|
1365
|
+
}
|
|
1365
1366
|
} else if (event.key === 'Escape') {
|
|
1366
1367
|
setSearchValue('');
|
|
1367
1368
|
}
|