@bonlineza/luxity-lib 2.36.1-beta.0 → 2.36.1-beta.1
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/LuxityDesktopHeader.js +138 -60
- package/LuxityFooter.js +6 -6
- package/LuxityMobileHeader.js +225 -99
- package/LuxitySideNav.js +219 -91
- package/build/bundle.css +1 -1
- package/build/bundle.js +345 -164
- package/package.json +1 -1
package/LuxityDesktopHeader.js
CHANGED
|
@@ -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,
|
|
@@ -730,8 +760,7 @@
|
|
|
730
760
|
name = _ref.name,
|
|
731
761
|
isVip = _ref.isVip,
|
|
732
762
|
shop = _ref.shop,
|
|
733
|
-
app = _ref.app
|
|
734
|
-
categoryConfig = _ref.categoryConfig;
|
|
763
|
+
app = _ref.app;
|
|
735
764
|
|
|
736
765
|
var _useState = React.useState(''),
|
|
737
766
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -743,7 +772,16 @@
|
|
|
743
772
|
loading = _useState4[0],
|
|
744
773
|
setLoading = _useState4[1];
|
|
745
774
|
|
|
746
|
-
var _useState5 = React.useState({
|
|
775
|
+
var _useState5 = React.useState({
|
|
776
|
+
latestArrivals: [],
|
|
777
|
+
bags: [],
|
|
778
|
+
shoes: [],
|
|
779
|
+
clothing: [],
|
|
780
|
+
accessories: [],
|
|
781
|
+
watches: [],
|
|
782
|
+
accessoriesCategories: [],
|
|
783
|
+
apparelStyles: []
|
|
784
|
+
}),
|
|
747
785
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
748
786
|
dropdownData = _useState6[0],
|
|
749
787
|
setDropdownData = _useState6[1];
|
|
@@ -844,60 +882,35 @@
|
|
|
844
882
|
}
|
|
845
883
|
};
|
|
846
884
|
|
|
847
|
-
|
|
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) {
|
|
885
|
+
function addCategoryToElements(elements, categoryName) {
|
|
859
886
|
return elements.map(function (element) {
|
|
860
887
|
return _objectSpread2(_objectSpread2({}, element), {}, {
|
|
861
888
|
category: categoryName
|
|
862
889
|
});
|
|
863
890
|
});
|
|
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
|
-
}
|
|
891
|
+
}
|
|
885
892
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
893
|
+
React.useMemo(function () {
|
|
894
|
+
setLoading(true);
|
|
895
|
+
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
896
|
+
var data = _ref2.data;
|
|
897
|
+
setLoading(false);
|
|
898
|
+
setDropdownData(function (prev) {
|
|
899
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
900
|
+
latestArrivals: data.latest_arrivals,
|
|
901
|
+
bags: data.bags,
|
|
902
|
+
shoes: data.shoes,
|
|
903
|
+
apparel: data.apparel,
|
|
904
|
+
accessories: data.accessories,
|
|
905
|
+
watches: data.watches,
|
|
906
|
+
accessoriesCategories: data.accessories_categories,
|
|
907
|
+
apparelStyles: data.apparel_styles
|
|
908
|
+
});
|
|
898
909
|
});
|
|
910
|
+
}).catch(function () {
|
|
911
|
+
return setHasError(true);
|
|
899
912
|
});
|
|
900
|
-
};
|
|
913
|
+
}, [menuData]);
|
|
901
914
|
|
|
902
915
|
var getMarginRight = function getMarginRight(userIsVip, userName) {
|
|
903
916
|
if (userIsVip) return '15px';
|
|
@@ -954,9 +967,74 @@
|
|
|
954
967
|
setSearchValue: setSearchValue
|
|
955
968
|
}), /*#__PURE__*/React__default.createElement("nav", {
|
|
956
969
|
className: "navbar__nav-links navbar__nav-links--wrap"
|
|
957
|
-
},
|
|
958
|
-
|
|
959
|
-
|
|
970
|
+
}, /*#__PURE__*/React__default.createElement(DropdownLink, {
|
|
971
|
+
title: "New",
|
|
972
|
+
imageSrc: newBrandsImage,
|
|
973
|
+
categoryElements: categoryElements,
|
|
974
|
+
brandElements: dropdownData.latestArrivals,
|
|
975
|
+
productsUrl: productsUrl,
|
|
976
|
+
categorySlug: "brands",
|
|
977
|
+
categoryTitle: "Brands",
|
|
978
|
+
isLoading: loading,
|
|
979
|
+
hasError: hasError,
|
|
980
|
+
LinkComponent: LinkComponent
|
|
981
|
+
}), /*#__PURE__*/React__default.createElement(DropdownLink, {
|
|
982
|
+
title: "Bags",
|
|
983
|
+
imageSrc: bagsImage,
|
|
984
|
+
categoryElements: addCategoryToElements(categoryElements, categories.bags.slug),
|
|
985
|
+
brandElements: dropdownData.bags,
|
|
986
|
+
productsUrl: productsUrl,
|
|
987
|
+
categorySlug: categories.bags.slug,
|
|
988
|
+
categoryTitle: categories.bags.name,
|
|
989
|
+
isLoading: loading,
|
|
990
|
+
hasError: hasError,
|
|
991
|
+
LinkComponent: LinkComponent
|
|
992
|
+
}), /*#__PURE__*/React__default.createElement(DropdownLink, {
|
|
993
|
+
title: "Shoes",
|
|
994
|
+
imageSrc: shoesImage,
|
|
995
|
+
categoryElements: addCategoryToElements(categoryElements, categories.shoes.slug),
|
|
996
|
+
brandElements: dropdownData.shoes,
|
|
997
|
+
productsUrl: productsUrl,
|
|
998
|
+
categorySlug: categories.shoes.slug,
|
|
999
|
+
categoryTitle: categories.shoes.name,
|
|
1000
|
+
isLoading: loading,
|
|
1001
|
+
hasError: hasError,
|
|
1002
|
+
LinkComponent: LinkComponent
|
|
1003
|
+
}), /*#__PURE__*/React__default.createElement(DropdownLink, {
|
|
1004
|
+
title: "Clothing",
|
|
1005
|
+
imageSrc: clothingImage,
|
|
1006
|
+
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories.clothing.slug),
|
|
1007
|
+
brandElements: dropdownData.apparel,
|
|
1008
|
+
productsUrl: productsUrl,
|
|
1009
|
+
categorySlug: categories.clothing.slug,
|
|
1010
|
+
categoryTitle: categories.clothing.name,
|
|
1011
|
+
isLoading: loading,
|
|
1012
|
+
hasError: hasError,
|
|
1013
|
+
LinkComponent: LinkComponent
|
|
1014
|
+
}), /*#__PURE__*/React__default.createElement(DropdownLink, {
|
|
1015
|
+
title: "Accessories",
|
|
1016
|
+
imageSrc: accessoriesImage,
|
|
1017
|
+
categoryElements: removeCategoryByName(dropdownData.accessoriesCategories, 'ACCESSORIES'),
|
|
1018
|
+
brandElements: dropdownData.accessories,
|
|
1019
|
+
productsUrl: productsUrl,
|
|
1020
|
+
categorySlug: categories.accessories.slug,
|
|
1021
|
+
categoryTitle: categories.accessories.name,
|
|
1022
|
+
isLoading: loading,
|
|
1023
|
+
hasError: hasError,
|
|
1024
|
+
LinkComponent: LinkComponent
|
|
1025
|
+
}), /*#__PURE__*/React__default.createElement(DropdownLink, {
|
|
1026
|
+
title: "Watches",
|
|
1027
|
+
imageSrc: watchesImage,
|
|
1028
|
+
categoryElements: addCategoryToElements(categoryElements, categories.watches.slug),
|
|
1029
|
+
brandElements: dropdownData.watches,
|
|
1030
|
+
productsUrl: productsUrl,
|
|
1031
|
+
categorySlug: categories.watches.slug,
|
|
1032
|
+
categoryTitle: categories.watches.name,
|
|
1033
|
+
isLoading: loading,
|
|
1034
|
+
hasError: hasError,
|
|
1035
|
+
LinkComponent: LinkComponent
|
|
1036
|
+
}), /*#__PURE__*/React__default.createElement("li", {
|
|
1037
|
+
className: "navbar__link"
|
|
960
1038
|
}, /*#__PURE__*/React__default.createElement(LinkComponent, {
|
|
961
1039
|
href: contactUsLink,
|
|
962
1040
|
className: "navbar__link-item navbar__link-item--desktop"
|
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
|
|
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
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
|
2307
|
+
}, "Copyright ", currentYear, " | Luxity (Pty) LTD | All Rights Reserved")));
|
|
2308
2308
|
};
|
|
2309
2309
|
|
|
2310
2310
|
var index = themed(LuxityFooter);
|