@bonlineza/luxity-lib 2.36.1-beta.0 → 2.36.1-beta.2

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.
@@ -9718,11 +9718,12 @@
9718
9718
  var _data$data$user = data.data.user,
9719
9719
  email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
9720
9720
  whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
9721
- vip = _data$data$user.vip;
9721
+ isEarlyAccess = _data$data$user.isEarlyAccess,
9722
+ isExclusive = _data$data$user.isExclusive;
9722
9723
 
9723
9724
  _this.setState({
9724
9725
  options: options,
9725
- isVip: vip,
9726
+ canReceiveWhatsAppNotifications: isEarlyAccess || isExclusive,
9726
9727
  emailSelectedOption: options.find(function (item) {
9727
9728
  return item.value === email_interest_send_schedule;
9728
9729
  }),
@@ -9737,7 +9738,7 @@
9737
9738
  options = _this$state.options,
9738
9739
  emailSelectedOption = _this$state.emailSelectedOption,
9739
9740
  whatsappSelectedOption = _this$state.whatsappSelectedOption,
9740
- isVip = _this$state.isVip,
9741
+ canReceiveWhatsAppNotifications = _this$state.canReceiveWhatsAppNotifications,
9741
9742
  updating = _this$state.request.fetching;
9742
9743
  return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
9743
9744
  getRequestPromise: _this.props.getSchedule,
@@ -9746,7 +9747,7 @@
9746
9747
  }
9747
9748
  }, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9748
9749
  className: "notification-settings"
9749
- }, isVip && /*#__PURE__*/React__default.createElement("div", {
9750
+ }, canReceiveWhatsAppNotifications && /*#__PURE__*/React__default.createElement("div", {
9750
9751
  className: "notification-row-wrapper"
9751
9752
  }, /*#__PURE__*/React__default.createElement("div", {
9752
9753
  className: "notification-dropdown-label"
@@ -9791,7 +9792,7 @@
9791
9792
  options: [],
9792
9793
  emailSelectedOption: null,
9793
9794
  whatsappSelectedOption: null,
9794
- isVip: false,
9795
+ canReceiveWhatsAppNotifications: false,
9795
9796
  request: _objectSpread2({}, request)
9796
9797
  };
9797
9798
  return _this;
package/Interests.js CHANGED
@@ -7624,11 +7624,12 @@
7624
7624
  var _data$data$user = data.data.user,
7625
7625
  email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
7626
7626
  whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
7627
- vip = _data$data$user.vip;
7627
+ isEarlyAccess = _data$data$user.isEarlyAccess,
7628
+ isExclusive = _data$data$user.isExclusive;
7628
7629
 
7629
7630
  _this.setState({
7630
7631
  options: options,
7631
- isVip: vip,
7632
+ canReceiveWhatsAppNotifications: isEarlyAccess || isExclusive,
7632
7633
  emailSelectedOption: options.find(function (item) {
7633
7634
  return item.value === email_interest_send_schedule;
7634
7635
  }),
@@ -7643,7 +7644,7 @@
7643
7644
  options = _this$state.options,
7644
7645
  emailSelectedOption = _this$state.emailSelectedOption,
7645
7646
  whatsappSelectedOption = _this$state.whatsappSelectedOption,
7646
- isVip = _this$state.isVip,
7647
+ canReceiveWhatsAppNotifications = _this$state.canReceiveWhatsAppNotifications,
7647
7648
  updating = _this$state.request.fetching;
7648
7649
  return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
7649
7650
  getRequestPromise: _this.props.getSchedule,
@@ -7652,7 +7653,7 @@
7652
7653
  }
7653
7654
  }, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7654
7655
  className: "notification-settings"
7655
- }, isVip && /*#__PURE__*/React__default.createElement("div", {
7656
+ }, canReceiveWhatsAppNotifications && /*#__PURE__*/React__default.createElement("div", {
7656
7657
  className: "notification-row-wrapper"
7657
7658
  }, /*#__PURE__*/React__default.createElement("div", {
7658
7659
  className: "notification-dropdown-label"
@@ -7697,7 +7698,7 @@
7697
7698
  options: [],
7698
7699
  emailSelectedOption: null,
7699
7700
  whatsappSelectedOption: null,
7700
- isVip: false,
7701
+ canReceiveWhatsAppNotifications: false,
7701
7702
  request: _objectSpread2({}, request)
7702
7703
  };
7703
7704
  return _this;
@@ -434,6 +434,37 @@
434
434
  }, contactNumber)));
435
435
  };
436
436
 
437
+ var categories = {
438
+ shoes: {
439
+ name: 'Shoes',
440
+ slug: 'shoes'
441
+ },
442
+ bags: {
443
+ name: 'Bags',
444
+ slug: 'bags'
445
+ },
446
+ clothing: {
447
+ name: 'Clothing',
448
+ slug: 'apparel'
449
+ },
450
+ watches: {
451
+ name: 'Watches',
452
+ slug: 'watches'
453
+ },
454
+ accessories: {
455
+ name: 'Accessories',
456
+ slug: 'accessories'
457
+ }
458
+ };
459
+
460
+ var removeCategoryByName = function removeCategoryByName(categories, name) {
461
+ var _categories$filter;
462
+
463
+ return (_categories$filter = categories === null || categories === void 0 ? void 0 : categories.filter(function (category) {
464
+ return category.name !== name;
465
+ })) !== null && _categories$filter !== void 0 ? _categories$filter : [];
466
+ };
467
+
437
468
  var SearchResults = function SearchResults(_ref) {
438
469
  var searchValue = _ref.searchValue,
439
470
  searchResults = _ref.searchResults,
@@ -690,14 +721,6 @@
690
721
  }))));
691
722
  };
692
723
 
693
- var removeCategoryByName = function removeCategoryByName(categories, name) {
694
- var _categories$filter;
695
-
696
- return (_categories$filter = categories === null || categories === void 0 ? void 0 : categories.filter(function (category) {
697
- return category.name.toLowerCase() !== name.toLowerCase();
698
- })) !== null && _categories$filter !== void 0 ? _categories$filter : [];
699
- };
700
-
701
724
  var LuxityDesktopHeader = function LuxityDesktopHeader(_ref) {
702
725
  var accountIcon = _ref.accountIcon,
703
726
  cartIcon = _ref.cartIcon,
@@ -705,6 +728,12 @@
705
728
  cartCount = _ref.cartCount,
706
729
  logoSrc = _ref.logoSrc,
707
730
  categoryElements = _ref.categoryElements,
731
+ newBrandsImage = _ref.newBrandsImage,
732
+ bagsImage = _ref.bagsImage,
733
+ shoesImage = _ref.shoesImage,
734
+ clothingImage = _ref.clothingImage,
735
+ accessoriesImage = _ref.accessoriesImage,
736
+ watchesImage = _ref.watchesImage,
708
737
  stores = _ref.stores,
709
738
  contactNumber = _ref.contactNumber,
710
739
  productsUrl = _ref.productsUrl,
@@ -719,6 +748,7 @@
719
748
  ourStoryLink = _ref.ourStoryLink,
720
749
  onLogoClick = _ref.onLogoClick,
721
750
  endpoint = _ref.endpoint,
751
+ menuData = _ref.menuData,
722
752
  onSearchSubmit = _ref.onSearchSubmit,
723
753
  onProductIdsReceived = _ref.onProductIdsReceived,
724
754
  currency = _ref.currency,
@@ -726,12 +756,13 @@
726
756
  onCurrencyChange = _ref.onCurrencyChange,
727
757
  isCurrencySelectionDisabled = _ref.isCurrencySelectionDisabled,
728
758
  tooltipContent = _ref.tooltipContent,
729
- vipIcon = _ref.vipIcon,
759
+ earlyAccessIcon = _ref.earlyAccessIcon,
760
+ exclusiveIcon = _ref.exclusiveIcon,
730
761
  name = _ref.name,
731
- isVip = _ref.isVip,
762
+ isEarlyAccess = _ref.isEarlyAccess,
763
+ isExclusive = _ref.isExclusive,
732
764
  shop = _ref.shop,
733
- app = _ref.app,
734
- categoryConfig = _ref.categoryConfig;
765
+ app = _ref.app;
735
766
 
736
767
  var _useState = React.useState(''),
737
768
  _useState2 = _slicedToArray(_useState, 2),
@@ -743,7 +774,16 @@
743
774
  loading = _useState4[0],
744
775
  setLoading = _useState4[1];
745
776
 
746
- var _useState5 = React.useState({}),
777
+ var _useState5 = React.useState({
778
+ latestArrivals: [],
779
+ bags: [],
780
+ shoes: [],
781
+ clothing: [],
782
+ accessories: [],
783
+ watches: [],
784
+ accessoriesCategories: [],
785
+ apparelStyles: []
786
+ }),
747
787
  _useState6 = _slicedToArray(_useState5, 2),
748
788
  dropdownData = _useState6[0],
749
789
  setDropdownData = _useState6[1];
@@ -844,63 +884,38 @@
844
884
  }
845
885
  };
846
886
 
847
- React.useMemo(function () {
848
- setLoading(true);
849
- axios.get("".concat(categoryConfig.menuData)).then(function (_ref2) {
850
- var data = _ref2.data;
851
- setLoading(false);
852
- setDropdownData(data);
853
- }).catch(function () {
854
- return setHasError(true);
855
- });
856
- }, [categoryConfig.menuData]);
857
-
858
- var addCategoryToElements = function addCategoryToElements(elements, categoryName) {
887
+ function addCategoryToElements(elements, categoryName) {
859
888
  return elements.map(function (element) {
860
889
  return _objectSpread2(_objectSpread2({}, element), {}, {
861
890
  category: categoryName
862
891
  });
863
892
  });
864
- };
865
-
866
- var renderDropdownLinks = function renderDropdownLinks() {
867
- return categoryConfig.categories.map(function (category) {
868
- var title = category.title,
869
- imageSrc = category.imageSrc,
870
- categorySlug = category.categorySlug,
871
- categoryName = category.categoryName,
872
- elementsKey = category.elementsKey,
873
- subCategoryElementsKey = category.subCategoryElementsKey,
874
- styleElementsKey = category.styleElementsKey;
875
- var categoryElementsProcessed = categoryElements;
876
-
877
- if (subCategoryElementsKey && dropdownData[subCategoryElementsKey]) {
878
- // show subcategory elements
879
- categoryElementsProcessed = removeCategoryByName(dropdownData[subCategoryElementsKey], categoryName);
880
- } else if (styleElementsKey && dropdownData[styleElementsKey]) {
881
- categoryElementsProcessed = addCategoryToElements(dropdownData[styleElementsKey], categorySlug);
882
- } else {
883
- categoryElementsProcessed = addCategoryToElements(categoryElementsProcessed, categorySlug);
884
- }
893
+ }
885
894
 
886
- return /*#__PURE__*/React__default.createElement(DropdownLink, {
887
- key: categorySlug,
888
- title: title,
889
- imageSrc: imageSrc,
890
- categoryElements: categoryElementsProcessed,
891
- brandElements: dropdownData[elementsKey] || [],
892
- productsUrl: productsUrl,
893
- categorySlug: categorySlug,
894
- categoryTitle: categoryName,
895
- isLoading: loading,
896
- hasError: hasError,
897
- LinkComponent: LinkComponent
895
+ React.useMemo(function () {
896
+ setLoading(true);
897
+ axios.get("".concat(menuData)).then(function (_ref2) {
898
+ var data = _ref2.data;
899
+ setLoading(false);
900
+ setDropdownData(function (prev) {
901
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
902
+ latestArrivals: data.latest_arrivals,
903
+ bags: data.bags,
904
+ shoes: data.shoes,
905
+ apparel: data.apparel,
906
+ accessories: data.accessories,
907
+ watches: data.watches,
908
+ accessoriesCategories: data.accessories_categories,
909
+ apparelStyles: data.apparel_styles
910
+ });
898
911
  });
912
+ }).catch(function () {
913
+ return setHasError(true);
899
914
  });
900
- };
915
+ }, [menuData]);
901
916
 
902
- var getMarginRight = function getMarginRight(userIsVip, userName) {
903
- if (userIsVip) return '15px';
917
+ var getMarginRight = function getMarginRight(showLoyaltyIcon, userName) {
918
+ if (showLoyaltyIcon) return '15px';
904
919
  if (userName) return '5px';
905
920
  return '18px';
906
921
  };
@@ -954,9 +969,74 @@
954
969
  setSearchValue: setSearchValue
955
970
  }), /*#__PURE__*/React__default.createElement("nav", {
956
971
  className: "navbar__nav-links navbar__nav-links--wrap"
957
- }, renderDropdownLinks(), !!stores.length && /*#__PURE__*/React__default.createElement("li", {
958
- className: "navbar__link",
959
- key: "Stores"
972
+ }, /*#__PURE__*/React__default.createElement(DropdownLink, {
973
+ title: "New",
974
+ imageSrc: newBrandsImage,
975
+ categoryElements: categoryElements,
976
+ brandElements: dropdownData.latestArrivals,
977
+ productsUrl: productsUrl,
978
+ categorySlug: "brands",
979
+ categoryTitle: "Brands",
980
+ isLoading: loading,
981
+ hasError: hasError,
982
+ LinkComponent: LinkComponent
983
+ }), /*#__PURE__*/React__default.createElement(DropdownLink, {
984
+ title: "Bags",
985
+ imageSrc: bagsImage,
986
+ categoryElements: addCategoryToElements(categoryElements, categories.bags.slug),
987
+ brandElements: dropdownData.bags,
988
+ productsUrl: productsUrl,
989
+ categorySlug: categories.bags.slug,
990
+ categoryTitle: categories.bags.name,
991
+ isLoading: loading,
992
+ hasError: hasError,
993
+ LinkComponent: LinkComponent
994
+ }), /*#__PURE__*/React__default.createElement(DropdownLink, {
995
+ title: "Shoes",
996
+ imageSrc: shoesImage,
997
+ categoryElements: addCategoryToElements(categoryElements, categories.shoes.slug),
998
+ brandElements: dropdownData.shoes,
999
+ productsUrl: productsUrl,
1000
+ categorySlug: categories.shoes.slug,
1001
+ categoryTitle: categories.shoes.name,
1002
+ isLoading: loading,
1003
+ hasError: hasError,
1004
+ LinkComponent: LinkComponent
1005
+ }), /*#__PURE__*/React__default.createElement(DropdownLink, {
1006
+ title: "Clothing",
1007
+ imageSrc: clothingImage,
1008
+ categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories.clothing.slug),
1009
+ brandElements: dropdownData.apparel,
1010
+ productsUrl: productsUrl,
1011
+ categorySlug: categories.clothing.slug,
1012
+ categoryTitle: categories.clothing.name,
1013
+ isLoading: loading,
1014
+ hasError: hasError,
1015
+ LinkComponent: LinkComponent
1016
+ }), /*#__PURE__*/React__default.createElement(DropdownLink, {
1017
+ title: "Accessories",
1018
+ imageSrc: accessoriesImage,
1019
+ categoryElements: removeCategoryByName(dropdownData.accessoriesCategories, 'ACCESSORIES'),
1020
+ brandElements: dropdownData.accessories,
1021
+ productsUrl: productsUrl,
1022
+ categorySlug: categories.accessories.slug,
1023
+ categoryTitle: categories.accessories.name,
1024
+ isLoading: loading,
1025
+ hasError: hasError,
1026
+ LinkComponent: LinkComponent
1027
+ }), /*#__PURE__*/React__default.createElement(DropdownLink, {
1028
+ title: "Watches",
1029
+ imageSrc: watchesImage,
1030
+ categoryElements: addCategoryToElements(categoryElements, categories.watches.slug),
1031
+ brandElements: dropdownData.watches,
1032
+ productsUrl: productsUrl,
1033
+ categorySlug: categories.watches.slug,
1034
+ categoryTitle: categories.watches.name,
1035
+ isLoading: loading,
1036
+ hasError: hasError,
1037
+ LinkComponent: LinkComponent
1038
+ }), /*#__PURE__*/React__default.createElement("li", {
1039
+ className: "navbar__link"
960
1040
  }, /*#__PURE__*/React__default.createElement(LinkComponent, {
961
1041
  href: contactUsLink,
962
1042
  className: "navbar__link-item navbar__link-item--desktop"
@@ -980,17 +1060,23 @@
980
1060
  className: "navbar__icon relative flex",
981
1061
  onClick: onAccountClick,
982
1062
  style: {
983
- marginRight: getMarginRight(isVip, name)
1063
+ marginRight: getMarginRight(isEarlyAccess || isExclusive, name)
984
1064
  }
985
1065
  }, /*#__PURE__*/React__default.createElement("img", {
986
1066
  src: accountIcon,
987
1067
  alt: "account-icon",
988
1068
  width: 20,
989
1069
  height: 20
990
- }), isVip && /*#__PURE__*/React__default.createElement("img", {
991
- src: vipIcon,
992
- alt: "vip-icon",
993
- className: "navbar__vip-icon",
1070
+ }), isEarlyAccess && /*#__PURE__*/React__default.createElement("img", {
1071
+ src: earlyAccessIcon,
1072
+ alt: "loyalty-icon",
1073
+ className: "navbar__loyalty-icon",
1074
+ width: 16,
1075
+ height: 16
1076
+ }), isExclusive && /*#__PURE__*/React__default.createElement("img", {
1077
+ src: exclusiveIcon,
1078
+ alt: "loyalty-icon",
1079
+ className: "navbar__loyalty-icon",
994
1080
  width: 16,
995
1081
  height: 16
996
1082
  })), name && /*#__PURE__*/React__default.createElement("button", {
package/LuxityFooter.js CHANGED
@@ -2102,13 +2102,13 @@
2102
2102
  setError = _useForm.setError;
2103
2103
 
2104
2104
  var renderLinks = function renderLinks(links, title) {
2105
- return !!links.length && /*#__PURE__*/React__default.createElement("div", {
2105
+ return /*#__PURE__*/React__default.createElement("div", {
2106
2106
  className: "footer__link-container"
2107
2107
  }, /*#__PURE__*/React__default.createElement("div", {
2108
2108
  className: "footer__link-title"
2109
2109
  }, title), /*#__PURE__*/React__default.createElement("div", {
2110
2110
  className: "footer__links"
2111
- }, links.map(function (link) {
2111
+ }, !!links.length && links.map(function (link) {
2112
2112
  return /*#__PURE__*/React__default.createElement("div", {
2113
2113
  className: "footer__link-wrapper",
2114
2114
  key: link.label
@@ -2277,7 +2277,7 @@
2277
2277
  height: 100
2278
2278
  })), /*#__PURE__*/React__default.createElement("p", {
2279
2279
  className: "footer__copyright"
2280
- }, "Copyright ", currentYear, " | Luxity (Pty) LTD | All Rights Reserved | Website Developed by B Online"))), /*#__PURE__*/React__default.createElement("div", {
2280
+ }, "Copyright ", currentYear, " | Luxity (Pty) LTD | All Rights Reserved"))), /*#__PURE__*/React__default.createElement("div", {
2281
2281
  className: "footer__wrapper footer__wrapper--mobile"
2282
2282
  }, /*#__PURE__*/React__default.createElement(CurrencySelect, {
2283
2283
  currency: currency,
@@ -2291,20 +2291,20 @@
2291
2291
  }), /*#__PURE__*/React__default.createElement(AccordionSection, {
2292
2292
  title: "POPULAR",
2293
2293
  links: popularLinks
2294
- }), !!sellLinks.length && /*#__PURE__*/React__default.createElement(AccordionSection, {
2294
+ }), /*#__PURE__*/React__default.createElement(AccordionSection, {
2295
2295
  title: "SELL",
2296
2296
  links: sellLinks
2297
2297
  }), /*#__PURE__*/React__default.createElement(AccordionSection, {
2298
2298
  title: "COMPANY",
2299
2299
  links: companyLinks
2300
- }), !!storeLinks.length && /*#__PURE__*/React__default.createElement(AccordionSection, {
2300
+ }), /*#__PURE__*/React__default.createElement(AccordionSection, {
2301
2301
  title: "CONNECT",
2302
2302
  links: storeLinks
2303
2303
  }), /*#__PURE__*/React__default.createElement("div", {
2304
2304
  className: "mt-5"
2305
2305
  }, renderSocialLinks(socialLinks)), /*#__PURE__*/React__default.createElement("p", {
2306
2306
  className: "footer__copyright footer__copyright--mobile"
2307
- }, "Copyright ", currentYear, " | Luxity (Pty) LTD | All Rights Reserved | Website Developed by B Online")));
2307
+ }, "Copyright ", currentYear, " | Luxity (Pty) LTD | All Rights Reserved")));
2308
2308
  };
2309
2309
 
2310
2310
  var index = themed(LuxityFooter);
@@ -9718,11 +9718,12 @@
9718
9718
  var _data$data$user = data.data.user,
9719
9719
  email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
9720
9720
  whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
9721
- vip = _data$data$user.vip;
9721
+ isEarlyAccess = _data$data$user.isEarlyAccess,
9722
+ isExclusive = _data$data$user.isExclusive;
9722
9723
 
9723
9724
  _this.setState({
9724
9725
  options: options,
9725
- isVip: vip,
9726
+ canReceiveWhatsAppNotifications: isEarlyAccess || isExclusive,
9726
9727
  emailSelectedOption: options.find(function (item) {
9727
9728
  return item.value === email_interest_send_schedule;
9728
9729
  }),
@@ -9737,7 +9738,7 @@
9737
9738
  options = _this$state.options,
9738
9739
  emailSelectedOption = _this$state.emailSelectedOption,
9739
9740
  whatsappSelectedOption = _this$state.whatsappSelectedOption,
9740
- isVip = _this$state.isVip,
9741
+ canReceiveWhatsAppNotifications = _this$state.canReceiveWhatsAppNotifications,
9741
9742
  updating = _this$state.request.fetching;
9742
9743
  return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
9743
9744
  getRequestPromise: _this.props.getSchedule,
@@ -9746,7 +9747,7 @@
9746
9747
  }
9747
9748
  }, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9748
9749
  className: "notification-settings"
9749
- }, isVip && /*#__PURE__*/React__default.createElement("div", {
9750
+ }, canReceiveWhatsAppNotifications && /*#__PURE__*/React__default.createElement("div", {
9750
9751
  className: "notification-row-wrapper"
9751
9752
  }, /*#__PURE__*/React__default.createElement("div", {
9752
9753
  className: "notification-dropdown-label"
@@ -9791,7 +9792,7 @@
9791
9792
  options: [],
9792
9793
  emailSelectedOption: null,
9793
9794
  whatsappSelectedOption: null,
9794
- isVip: false,
9795
+ canReceiveWhatsAppNotifications: false,
9795
9796
  request: _objectSpread2({}, request)
9796
9797
  };
9797
9798
  return _this;