@bonlineza/luxity-lib 2.32.9 → 2.33.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 +14 -18
- package/LuxityMobileHeader.js +69 -36
- package/LuxitySideNav.js +56 -26
- package/build/bundle.js +50 -39
- package/package.json +1 -1
- package/build/.gitignore +0 -3
- package/build/.npmignore +0 -0
package/LuxityDesktopHeader.js
CHANGED
|
@@ -234,11 +234,6 @@
|
|
|
234
234
|
React.createElement("span", { style: style(3) })));
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
var getBrands = function getBrands() {
|
|
238
|
-
return {
|
|
239
|
-
query: "{\n latest_arrivals: luxity_brands(has_products: true, limit: 1000, page: 1, sort_by: \"name|asc\") {data {id name slug}}\n bags: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: BAGS, sort_by: \"name|asc\") {data {id name slug}}\n shoes: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: SHOES, sort_by: \"name|asc\") {data {id name slug}}\n apparel: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: APPAREL, sort_by: \"name|asc\") {data {id name slug}}\n accessories: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: ACCESSORIES, sort_by: \"name|asc\") {data {id name slug}}\n watches: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: WATCHES, sort_by: \"name|asc\") {data {id name slug}}\n accessories_categories: luxity_accessories_categories_list { id name slug }\n apparel_styles: luxity_apparel_styles_list { name slug }\n } "
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
237
|
var searchProducts = function searchProducts(search, limit) {
|
|
243
238
|
return {
|
|
244
239
|
query: "\n query SearchProducts($search: String!, $limit: Int!) {\n luxity_products_serach_results(search: $search, limit: $limit) {\n brands {\n name\n link\n }\n products {\n name\n link\n }\n luxity_product_ids\n }\n }\n ",
|
|
@@ -319,13 +314,13 @@
|
|
|
319
314
|
}, !!stores.length && stores.map(function (store) {
|
|
320
315
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
321
316
|
className: "stores-dropdown__store-details",
|
|
322
|
-
key: store.
|
|
317
|
+
key: store.title
|
|
323
318
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
324
319
|
className: "stores-dropdown__store-image"
|
|
325
320
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
326
321
|
className: "stores-dropdown__image",
|
|
327
322
|
src: store.image,
|
|
328
|
-
alt: store.
|
|
323
|
+
alt: store.title
|
|
329
324
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
330
325
|
className: "stores-dropdown__store-info"
|
|
331
326
|
}, /*#__PURE__*/React__default.createElement("h4", {
|
|
@@ -464,6 +459,7 @@
|
|
|
464
459
|
ourStoryLink = _ref.ourStoryLink,
|
|
465
460
|
onLogoClick = _ref.onLogoClick,
|
|
466
461
|
endpoint = _ref.endpoint,
|
|
462
|
+
menuData = _ref.menuData,
|
|
467
463
|
onSearchSubmit = _ref.onSearchSubmit,
|
|
468
464
|
onProductIdsReceived = _ref.onProductIdsReceived,
|
|
469
465
|
shop = _ref.shop,
|
|
@@ -588,25 +584,25 @@
|
|
|
588
584
|
|
|
589
585
|
React.useMemo(function () {
|
|
590
586
|
setLoading(true);
|
|
591
|
-
axios.
|
|
587
|
+
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
592
588
|
var data = _ref2.data;
|
|
593
589
|
setLoading(false);
|
|
594
590
|
setDropdownData(function (prev) {
|
|
595
591
|
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
596
|
-
latestArrivals: data.
|
|
597
|
-
bags: data.
|
|
598
|
-
shoes: data.
|
|
599
|
-
apparel: data.
|
|
600
|
-
accessories: data.
|
|
601
|
-
watches: data.
|
|
602
|
-
accessoriesCategories: data.
|
|
603
|
-
apparelStyles: data.
|
|
592
|
+
latestArrivals: data.latest_arrivals,
|
|
593
|
+
bags: data.bags,
|
|
594
|
+
shoes: data.shoes,
|
|
595
|
+
apparel: data.apparel,
|
|
596
|
+
accessories: data.accessories,
|
|
597
|
+
watches: data.watches,
|
|
598
|
+
accessoriesCategories: data.accessories_categories,
|
|
599
|
+
apparelStyles: data.apparel_styles
|
|
604
600
|
});
|
|
605
601
|
});
|
|
606
602
|
}).catch(function () {
|
|
607
603
|
return setHasError(true);
|
|
608
604
|
});
|
|
609
|
-
}, [
|
|
605
|
+
}, [menuData]);
|
|
610
606
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
611
607
|
className: "navbar"
|
|
612
608
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -717,7 +713,7 @@
|
|
|
717
713
|
}, /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
718
714
|
title: "Department",
|
|
719
715
|
imageSrc: clothingImage,
|
|
720
|
-
categoryElements: dropdownData.apparelStyles,
|
|
716
|
+
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories.clothing.slug),
|
|
721
717
|
brandElements: dropdownData.apparel,
|
|
722
718
|
productsUrl: productsUrl,
|
|
723
719
|
categorySlug: categories.clothing.slug,
|
package/LuxityMobileHeader.js
CHANGED
|
@@ -487,11 +487,16 @@
|
|
|
487
487
|
className: "side-nav__sub-menu-title"
|
|
488
488
|
}, subMenuCategoryTitle), /*#__PURE__*/React__default.createElement("div", {
|
|
489
489
|
className: "side-nav__elements"
|
|
490
|
-
}, categoryElements.map(function (
|
|
491
|
-
return /*#__PURE__*/React__default.createElement("a", {
|
|
492
|
-
href: "".concat(productUrl, "/").concat(
|
|
493
|
-
className: "
|
|
494
|
-
|
|
490
|
+
}, categoryElements.map(function (categoryElement) {
|
|
491
|
+
return categoryElement.category ? /*#__PURE__*/React__default.createElement("a", {
|
|
492
|
+
href: "".concat(productUrl, "/").concat(categoryElement.category, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
493
|
+
className: "dropdown__element",
|
|
494
|
+
key: categoryElement.name
|
|
495
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase()) : /*#__PURE__*/React__default.createElement("a", {
|
|
496
|
+
href: "".concat(productUrl, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
497
|
+
className: "dropdown__element",
|
|
498
|
+
key: categoryElement.name
|
|
499
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase());
|
|
495
500
|
})), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
496
501
|
className: "side-nav__elements"
|
|
497
502
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -507,21 +512,6 @@
|
|
|
507
512
|
})))));
|
|
508
513
|
};
|
|
509
514
|
|
|
510
|
-
var getBrands = function getBrands() {
|
|
511
|
-
return {
|
|
512
|
-
query: "{\n latest_arrivals: luxity_brands(has_products: true, limit: 1000, page: 1, sort_by: \"name|asc\") {data {id name slug}}\n bags: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: BAGS, sort_by: \"name|asc\") {data {id name slug}}\n shoes: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: SHOES, sort_by: \"name|asc\") {data {id name slug}}\n apparel: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: APPAREL, sort_by: \"name|asc\") {data {id name slug}}\n accessories: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: ACCESSORIES, sort_by: \"name|asc\") {data {id name slug}}\n watches: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: WATCHES, sort_by: \"name|asc\") {data {id name slug}}\n accessories_categories: luxity_accessories_categories_list { id name slug }\n apparel_styles: luxity_apparel_styles_list { name slug }\n } "
|
|
513
|
-
};
|
|
514
|
-
};
|
|
515
|
-
var searchProducts = function searchProducts(search, limit) {
|
|
516
|
-
return {
|
|
517
|
-
query: "\n query SearchProducts($search: String!, $limit: Int!) {\n luxity_products_serach_results(search: $search, limit: $limit) {\n brands {\n name\n link\n }\n products {\n name\n link\n }\n luxity_product_ids\n }\n }\n ",
|
|
518
|
-
variables: {
|
|
519
|
-
search: search,
|
|
520
|
-
limit: limit
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
};
|
|
524
|
-
|
|
525
515
|
var removeCategoryByName = function removeCategoryByName(categories, name) {
|
|
526
516
|
var _categories$filter;
|
|
527
517
|
|
|
@@ -530,6 +520,29 @@
|
|
|
530
520
|
})) !== null && _categories$filter !== void 0 ? _categories$filter : [];
|
|
531
521
|
};
|
|
532
522
|
|
|
523
|
+
var categories = {
|
|
524
|
+
shoes: {
|
|
525
|
+
name: 'Shoes',
|
|
526
|
+
slug: 'shoes'
|
|
527
|
+
},
|
|
528
|
+
bags: {
|
|
529
|
+
name: 'Bags',
|
|
530
|
+
slug: 'bags'
|
|
531
|
+
},
|
|
532
|
+
clothing: {
|
|
533
|
+
name: 'Clothing',
|
|
534
|
+
slug: 'apparel'
|
|
535
|
+
},
|
|
536
|
+
watches: {
|
|
537
|
+
name: 'Watches',
|
|
538
|
+
slug: 'watches'
|
|
539
|
+
},
|
|
540
|
+
accessories: {
|
|
541
|
+
name: 'Accessories',
|
|
542
|
+
slug: 'accessories'
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
|
|
533
546
|
var LuxitySideNav = function LuxitySideNav(_ref) {
|
|
534
547
|
var accordionIcon = _ref.accordionIcon,
|
|
535
548
|
closeIcon = _ref.closeIcon,
|
|
@@ -545,7 +558,7 @@
|
|
|
545
558
|
categoryElements = _ref.categoryElements,
|
|
546
559
|
showSideNav = _ref.showSideNav,
|
|
547
560
|
onMenuClick = _ref.onMenuClick,
|
|
548
|
-
|
|
561
|
+
menuData = _ref.menuData;
|
|
549
562
|
|
|
550
563
|
var _useState = React.useState(false),
|
|
551
564
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -606,27 +619,35 @@
|
|
|
606
619
|
}
|
|
607
620
|
};
|
|
608
621
|
|
|
622
|
+
function addCategoryToElements(elements, categoryName) {
|
|
623
|
+
return elements.map(function (element) {
|
|
624
|
+
return _objectSpread2(_objectSpread2({}, element), {}, {
|
|
625
|
+
category: categoryName
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
|
|
609
630
|
React.useMemo(function () {
|
|
610
631
|
setLoading(true);
|
|
611
|
-
axios.
|
|
632
|
+
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
612
633
|
var data = _ref2.data;
|
|
613
634
|
setLoading(false);
|
|
614
635
|
setDropdownData(function (prev) {
|
|
615
636
|
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
616
|
-
latestArrivals: data.
|
|
617
|
-
bags: data.
|
|
618
|
-
shoes: data.
|
|
619
|
-
apparel: data.
|
|
620
|
-
accessories: data.
|
|
621
|
-
watches: data.
|
|
622
|
-
accessoriesCategories: data.
|
|
623
|
-
apparelStyles: data.
|
|
637
|
+
latestArrivals: data.latest_arrivals,
|
|
638
|
+
bags: data.bags,
|
|
639
|
+
shoes: data.shoes,
|
|
640
|
+
apparel: data.apparel,
|
|
641
|
+
accessories: data.accessories,
|
|
642
|
+
watches: data.watches,
|
|
643
|
+
accessoriesCategories: data.accessories_categories,
|
|
644
|
+
apparelStyles: data.apparel_styles
|
|
624
645
|
});
|
|
625
646
|
});
|
|
626
647
|
}).catch(function () {
|
|
627
648
|
return setHasError(true);
|
|
628
649
|
});
|
|
629
|
-
}, [
|
|
650
|
+
}, [menuData]);
|
|
630
651
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
631
652
|
className: "side-nav"
|
|
632
653
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -794,7 +815,7 @@
|
|
|
794
815
|
backIcon: backIcon,
|
|
795
816
|
subMenuCategoryTitle: "Department",
|
|
796
817
|
productUrl: productUrl,
|
|
797
|
-
categoryElements: categoryElements,
|
|
818
|
+
categoryElements: addCategoryToElements(categoryElements, categories.bags.slug),
|
|
798
819
|
subMenuBrandsTitle: "Bag Brands",
|
|
799
820
|
brandsList: dropdownData.bags,
|
|
800
821
|
categorySlug: displayedSubMenu,
|
|
@@ -806,7 +827,7 @@
|
|
|
806
827
|
backIcon: backIcon,
|
|
807
828
|
subMenuCategoryTitle: "Department",
|
|
808
829
|
productUrl: productUrl,
|
|
809
|
-
categoryElements: categoryElements,
|
|
830
|
+
categoryElements: addCategoryToElements(categoryElements, categories.shoes.slug),
|
|
810
831
|
subMenuBrandsTitle: "Shoe Brands",
|
|
811
832
|
brandsList: dropdownData.shoes,
|
|
812
833
|
categorySlug: displayedSubMenu,
|
|
@@ -818,7 +839,7 @@
|
|
|
818
839
|
backIcon: backIcon,
|
|
819
840
|
subMenuCategoryTitle: "Department",
|
|
820
841
|
productUrl: productUrl,
|
|
821
|
-
categoryElements: dropdownData.apparelStyles,
|
|
842
|
+
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories.clothing.slug),
|
|
822
843
|
subMenuBrandsTitle: "Clothing Brands",
|
|
823
844
|
brandsList: dropdownData.apparel,
|
|
824
845
|
categorySlug: displayedSubMenu,
|
|
@@ -842,7 +863,7 @@
|
|
|
842
863
|
backIcon: backIcon,
|
|
843
864
|
subMenuCategoryTitle: "Department",
|
|
844
865
|
productUrl: productUrl,
|
|
845
|
-
categoryElements: categoryElements,
|
|
866
|
+
categoryElements: addCategoryToElements(categoryElements, categories.watches.slug),
|
|
846
867
|
subMenuBrandsTitle: "Watches Brands",
|
|
847
868
|
brandsList: dropdownData.watches,
|
|
848
869
|
categorySlug: displayedSubMenu,
|
|
@@ -858,6 +879,16 @@
|
|
|
858
879
|
})));
|
|
859
880
|
};
|
|
860
881
|
|
|
882
|
+
var searchProducts = function searchProducts(search, limit) {
|
|
883
|
+
return {
|
|
884
|
+
query: "\n query SearchProducts($search: String!, $limit: Int!) {\n luxity_products_serach_results(search: $search, limit: $limit) {\n brands {\n name\n link\n }\n products {\n name\n link\n }\n luxity_product_ids\n }\n }\n ",
|
|
885
|
+
variables: {
|
|
886
|
+
search: search,
|
|
887
|
+
limit: limit
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
|
|
861
892
|
var SearchResults = function SearchResults(_ref) {
|
|
862
893
|
var searchValue = _ref.searchValue,
|
|
863
894
|
searchResults = _ref.searchResults,
|
|
@@ -937,6 +968,7 @@
|
|
|
937
968
|
onLogoClick = _ref.onLogoClick,
|
|
938
969
|
onLuxityShopClick = _ref.onLuxityShopClick,
|
|
939
970
|
endpoint = _ref.endpoint,
|
|
971
|
+
menuData = _ref.menuData,
|
|
940
972
|
onSearchSubmit = _ref.onSearchSubmit,
|
|
941
973
|
onProductIdsReceived = _ref.onProductIdsReceived,
|
|
942
974
|
onLogoutClick = _ref.onLogoutClick,
|
|
@@ -1196,7 +1228,8 @@
|
|
|
1196
1228
|
categoryElements: categoryElements,
|
|
1197
1229
|
showSideNav: showSideNav,
|
|
1198
1230
|
onMenuClick: onMenuClick,
|
|
1199
|
-
endpoint: endpoint
|
|
1231
|
+
endpoint: endpoint,
|
|
1232
|
+
menuData: menuData
|
|
1200
1233
|
}), app && /*#__PURE__*/React__default.createElement(LuxityAppSideNav, {
|
|
1201
1234
|
accordionIcon: accordionIcon,
|
|
1202
1235
|
closeIcon: closeIcon,
|
package/LuxitySideNav.js
CHANGED
|
@@ -185,11 +185,16 @@
|
|
|
185
185
|
className: "side-nav__sub-menu-title"
|
|
186
186
|
}, subMenuCategoryTitle), /*#__PURE__*/React__default.createElement("div", {
|
|
187
187
|
className: "side-nav__elements"
|
|
188
|
-
}, categoryElements.map(function (
|
|
189
|
-
return /*#__PURE__*/React__default.createElement("a", {
|
|
190
|
-
href: "".concat(productUrl, "/").concat(
|
|
191
|
-
className: "
|
|
192
|
-
|
|
188
|
+
}, categoryElements.map(function (categoryElement) {
|
|
189
|
+
return categoryElement.category ? /*#__PURE__*/React__default.createElement("a", {
|
|
190
|
+
href: "".concat(productUrl, "/").concat(categoryElement.category, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
191
|
+
className: "dropdown__element",
|
|
192
|
+
key: categoryElement.name
|
|
193
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase()) : /*#__PURE__*/React__default.createElement("a", {
|
|
194
|
+
href: "".concat(productUrl, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
195
|
+
className: "dropdown__element",
|
|
196
|
+
key: categoryElement.name
|
|
197
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase());
|
|
193
198
|
})), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
194
199
|
className: "side-nav__elements"
|
|
195
200
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -205,12 +210,6 @@
|
|
|
205
210
|
})))));
|
|
206
211
|
};
|
|
207
212
|
|
|
208
|
-
var getBrands = function getBrands() {
|
|
209
|
-
return {
|
|
210
|
-
query: "{\n latest_arrivals: luxity_brands(has_products: true, limit: 1000, page: 1, sort_by: \"name|asc\") {data {id name slug}}\n bags: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: BAGS, sort_by: \"name|asc\") {data {id name slug}}\n shoes: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: SHOES, sort_by: \"name|asc\") {data {id name slug}}\n apparel: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: APPAREL, sort_by: \"name|asc\") {data {id name slug}}\n accessories: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: ACCESSORIES, sort_by: \"name|asc\") {data {id name slug}}\n watches: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: WATCHES, sort_by: \"name|asc\") {data {id name slug}}\n accessories_categories: luxity_accessories_categories_list { id name slug }\n apparel_styles: luxity_apparel_styles_list { name slug }\n } "
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
|
|
214
213
|
var removeCategoryByName = function removeCategoryByName(categories, name) {
|
|
215
214
|
var _categories$filter;
|
|
216
215
|
|
|
@@ -219,6 +218,29 @@
|
|
|
219
218
|
})) !== null && _categories$filter !== void 0 ? _categories$filter : [];
|
|
220
219
|
};
|
|
221
220
|
|
|
221
|
+
var categories = {
|
|
222
|
+
shoes: {
|
|
223
|
+
name: 'Shoes',
|
|
224
|
+
slug: 'shoes'
|
|
225
|
+
},
|
|
226
|
+
bags: {
|
|
227
|
+
name: 'Bags',
|
|
228
|
+
slug: 'bags'
|
|
229
|
+
},
|
|
230
|
+
clothing: {
|
|
231
|
+
name: 'Clothing',
|
|
232
|
+
slug: 'apparel'
|
|
233
|
+
},
|
|
234
|
+
watches: {
|
|
235
|
+
name: 'Watches',
|
|
236
|
+
slug: 'watches'
|
|
237
|
+
},
|
|
238
|
+
accessories: {
|
|
239
|
+
name: 'Accessories',
|
|
240
|
+
slug: 'accessories'
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
|
|
222
244
|
var LuxitySideNav = function LuxitySideNav(_ref) {
|
|
223
245
|
var accordionIcon = _ref.accordionIcon,
|
|
224
246
|
closeIcon = _ref.closeIcon,
|
|
@@ -234,7 +256,7 @@
|
|
|
234
256
|
categoryElements = _ref.categoryElements,
|
|
235
257
|
showSideNav = _ref.showSideNav,
|
|
236
258
|
onMenuClick = _ref.onMenuClick,
|
|
237
|
-
|
|
259
|
+
menuData = _ref.menuData;
|
|
238
260
|
|
|
239
261
|
var _useState = React.useState(false),
|
|
240
262
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -295,27 +317,35 @@
|
|
|
295
317
|
}
|
|
296
318
|
};
|
|
297
319
|
|
|
320
|
+
function addCategoryToElements(elements, categoryName) {
|
|
321
|
+
return elements.map(function (element) {
|
|
322
|
+
return _objectSpread2(_objectSpread2({}, element), {}, {
|
|
323
|
+
category: categoryName
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
298
328
|
React.useMemo(function () {
|
|
299
329
|
setLoading(true);
|
|
300
|
-
axios.
|
|
330
|
+
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
301
331
|
var data = _ref2.data;
|
|
302
332
|
setLoading(false);
|
|
303
333
|
setDropdownData(function (prev) {
|
|
304
334
|
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
305
|
-
latestArrivals: data.
|
|
306
|
-
bags: data.
|
|
307
|
-
shoes: data.
|
|
308
|
-
apparel: data.
|
|
309
|
-
accessories: data.
|
|
310
|
-
watches: data.
|
|
311
|
-
accessoriesCategories: data.
|
|
312
|
-
apparelStyles: data.
|
|
335
|
+
latestArrivals: data.latest_arrivals,
|
|
336
|
+
bags: data.bags,
|
|
337
|
+
shoes: data.shoes,
|
|
338
|
+
apparel: data.apparel,
|
|
339
|
+
accessories: data.accessories,
|
|
340
|
+
watches: data.watches,
|
|
341
|
+
accessoriesCategories: data.accessories_categories,
|
|
342
|
+
apparelStyles: data.apparel_styles
|
|
313
343
|
});
|
|
314
344
|
});
|
|
315
345
|
}).catch(function () {
|
|
316
346
|
return setHasError(true);
|
|
317
347
|
});
|
|
318
|
-
}, [
|
|
348
|
+
}, [menuData]);
|
|
319
349
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
320
350
|
className: "side-nav"
|
|
321
351
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -483,7 +513,7 @@
|
|
|
483
513
|
backIcon: backIcon,
|
|
484
514
|
subMenuCategoryTitle: "Department",
|
|
485
515
|
productUrl: productUrl,
|
|
486
|
-
categoryElements: categoryElements,
|
|
516
|
+
categoryElements: addCategoryToElements(categoryElements, categories.bags.slug),
|
|
487
517
|
subMenuBrandsTitle: "Bag Brands",
|
|
488
518
|
brandsList: dropdownData.bags,
|
|
489
519
|
categorySlug: displayedSubMenu,
|
|
@@ -495,7 +525,7 @@
|
|
|
495
525
|
backIcon: backIcon,
|
|
496
526
|
subMenuCategoryTitle: "Department",
|
|
497
527
|
productUrl: productUrl,
|
|
498
|
-
categoryElements: categoryElements,
|
|
528
|
+
categoryElements: addCategoryToElements(categoryElements, categories.shoes.slug),
|
|
499
529
|
subMenuBrandsTitle: "Shoe Brands",
|
|
500
530
|
brandsList: dropdownData.shoes,
|
|
501
531
|
categorySlug: displayedSubMenu,
|
|
@@ -507,7 +537,7 @@
|
|
|
507
537
|
backIcon: backIcon,
|
|
508
538
|
subMenuCategoryTitle: "Department",
|
|
509
539
|
productUrl: productUrl,
|
|
510
|
-
categoryElements: dropdownData.apparelStyles,
|
|
540
|
+
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories.clothing.slug),
|
|
511
541
|
subMenuBrandsTitle: "Clothing Brands",
|
|
512
542
|
brandsList: dropdownData.apparel,
|
|
513
543
|
categorySlug: displayedSubMenu,
|
|
@@ -531,7 +561,7 @@
|
|
|
531
561
|
backIcon: backIcon,
|
|
532
562
|
subMenuCategoryTitle: "Department",
|
|
533
563
|
productUrl: productUrl,
|
|
534
|
-
categoryElements: categoryElements,
|
|
564
|
+
categoryElements: addCategoryToElements(categoryElements, categories.watches.slug),
|
|
535
565
|
subMenuBrandsTitle: "Watches Brands",
|
|
536
566
|
brandsList: dropdownData.watches,
|
|
537
567
|
categorySlug: displayedSubMenu,
|
package/build/bundle.js
CHANGED
|
@@ -14528,11 +14528,6 @@
|
|
|
14528
14528
|
React.createElement("span", { style: style(3) })));
|
|
14529
14529
|
}
|
|
14530
14530
|
|
|
14531
|
-
var getBrands = function getBrands() {
|
|
14532
|
-
return {
|
|
14533
|
-
query: "{\n latest_arrivals: luxity_brands(has_products: true, limit: 1000, page: 1, sort_by: \"name|asc\") {data {id name slug}}\n bags: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: BAGS, sort_by: \"name|asc\") {data {id name slug}}\n shoes: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: SHOES, sort_by: \"name|asc\") {data {id name slug}}\n apparel: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: APPAREL, sort_by: \"name|asc\") {data {id name slug}}\n accessories: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: ACCESSORIES, sort_by: \"name|asc\") {data {id name slug}}\n watches: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: WATCHES, sort_by: \"name|asc\") {data {id name slug}}\n accessories_categories: luxity_accessories_categories_list { id name slug }\n apparel_styles: luxity_apparel_styles_list { name slug }\n } "
|
|
14534
|
-
};
|
|
14535
|
-
};
|
|
14536
14531
|
var searchProducts = function searchProducts(search, limit) {
|
|
14537
14532
|
return {
|
|
14538
14533
|
query: "\n query SearchProducts($search: String!, $limit: Int!) {\n luxity_products_serach_results(search: $search, limit: $limit) {\n brands {\n name\n link\n }\n products {\n name\n link\n }\n luxity_product_ids\n }\n }\n ",
|
|
@@ -14613,13 +14608,13 @@
|
|
|
14613
14608
|
}, !!stores.length && stores.map(function (store) {
|
|
14614
14609
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
14615
14610
|
className: "stores-dropdown__store-details",
|
|
14616
|
-
key: store.
|
|
14611
|
+
key: store.title
|
|
14617
14612
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14618
14613
|
className: "stores-dropdown__store-image"
|
|
14619
14614
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
14620
14615
|
className: "stores-dropdown__image",
|
|
14621
14616
|
src: store.image,
|
|
14622
|
-
alt: store.
|
|
14617
|
+
alt: store.title
|
|
14623
14618
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
14624
14619
|
className: "stores-dropdown__store-info"
|
|
14625
14620
|
}, /*#__PURE__*/React__default.createElement("h4", {
|
|
@@ -14758,6 +14753,7 @@
|
|
|
14758
14753
|
ourStoryLink = _ref.ourStoryLink,
|
|
14759
14754
|
onLogoClick = _ref.onLogoClick,
|
|
14760
14755
|
endpoint = _ref.endpoint,
|
|
14756
|
+
menuData = _ref.menuData,
|
|
14761
14757
|
onSearchSubmit = _ref.onSearchSubmit,
|
|
14762
14758
|
onProductIdsReceived = _ref.onProductIdsReceived,
|
|
14763
14759
|
shop = _ref.shop,
|
|
@@ -14882,25 +14878,25 @@
|
|
|
14882
14878
|
|
|
14883
14879
|
React.useMemo(function () {
|
|
14884
14880
|
setLoading(true);
|
|
14885
|
-
axios.
|
|
14881
|
+
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
14886
14882
|
var data = _ref2.data;
|
|
14887
14883
|
setLoading(false);
|
|
14888
14884
|
setDropdownData(function (prev) {
|
|
14889
14885
|
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
14890
|
-
latestArrivals: data.
|
|
14891
|
-
bags: data.
|
|
14892
|
-
shoes: data.
|
|
14893
|
-
apparel: data.
|
|
14894
|
-
accessories: data.
|
|
14895
|
-
watches: data.
|
|
14896
|
-
accessoriesCategories: data.
|
|
14897
|
-
apparelStyles: data.
|
|
14886
|
+
latestArrivals: data.latest_arrivals,
|
|
14887
|
+
bags: data.bags,
|
|
14888
|
+
shoes: data.shoes,
|
|
14889
|
+
apparel: data.apparel,
|
|
14890
|
+
accessories: data.accessories,
|
|
14891
|
+
watches: data.watches,
|
|
14892
|
+
accessoriesCategories: data.accessories_categories,
|
|
14893
|
+
apparelStyles: data.apparel_styles
|
|
14898
14894
|
});
|
|
14899
14895
|
});
|
|
14900
14896
|
}).catch(function () {
|
|
14901
14897
|
return setHasError(true);
|
|
14902
14898
|
});
|
|
14903
|
-
}, [
|
|
14899
|
+
}, [menuData]);
|
|
14904
14900
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
14905
14901
|
className: "navbar"
|
|
14906
14902
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -15011,7 +15007,7 @@
|
|
|
15011
15007
|
}, /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
15012
15008
|
title: "Department",
|
|
15013
15009
|
imageSrc: clothingImage,
|
|
15014
|
-
categoryElements: dropdownData.apparelStyles,
|
|
15010
|
+
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories$1.clothing.slug),
|
|
15015
15011
|
brandElements: dropdownData.apparel,
|
|
15016
15012
|
productsUrl: productsUrl,
|
|
15017
15013
|
categorySlug: categories$1.clothing.slug,
|
|
@@ -15193,11 +15189,16 @@
|
|
|
15193
15189
|
className: "side-nav__sub-menu-title"
|
|
15194
15190
|
}, subMenuCategoryTitle), /*#__PURE__*/React__default.createElement("div", {
|
|
15195
15191
|
className: "side-nav__elements"
|
|
15196
|
-
}, categoryElements.map(function (
|
|
15197
|
-
return /*#__PURE__*/React__default.createElement("a", {
|
|
15198
|
-
href: "".concat(productUrl, "/").concat(
|
|
15199
|
-
className: "
|
|
15200
|
-
|
|
15192
|
+
}, categoryElements.map(function (categoryElement) {
|
|
15193
|
+
return categoryElement.category ? /*#__PURE__*/React__default.createElement("a", {
|
|
15194
|
+
href: "".concat(productUrl, "/").concat(categoryElement.category, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
15195
|
+
className: "dropdown__element",
|
|
15196
|
+
key: categoryElement.name
|
|
15197
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase()) : /*#__PURE__*/React__default.createElement("a", {
|
|
15198
|
+
href: "".concat(productUrl, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
15199
|
+
className: "dropdown__element",
|
|
15200
|
+
key: categoryElement.name
|
|
15201
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase());
|
|
15201
15202
|
})), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
15202
15203
|
className: "side-nav__elements"
|
|
15203
15204
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -15228,7 +15229,7 @@
|
|
|
15228
15229
|
categoryElements = _ref.categoryElements,
|
|
15229
15230
|
showSideNav = _ref.showSideNav,
|
|
15230
15231
|
onMenuClick = _ref.onMenuClick,
|
|
15231
|
-
|
|
15232
|
+
menuData = _ref.menuData;
|
|
15232
15233
|
|
|
15233
15234
|
var _useState = React.useState(false),
|
|
15234
15235
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -15289,27 +15290,35 @@
|
|
|
15289
15290
|
}
|
|
15290
15291
|
};
|
|
15291
15292
|
|
|
15293
|
+
function addCategoryToElements(elements, categoryName) {
|
|
15294
|
+
return elements.map(function (element) {
|
|
15295
|
+
return _objectSpread2(_objectSpread2({}, element), {}, {
|
|
15296
|
+
category: categoryName
|
|
15297
|
+
});
|
|
15298
|
+
});
|
|
15299
|
+
}
|
|
15300
|
+
|
|
15292
15301
|
React.useMemo(function () {
|
|
15293
15302
|
setLoading(true);
|
|
15294
|
-
axios.
|
|
15303
|
+
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
15295
15304
|
var data = _ref2.data;
|
|
15296
15305
|
setLoading(false);
|
|
15297
15306
|
setDropdownData(function (prev) {
|
|
15298
15307
|
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
15299
|
-
latestArrivals: data.
|
|
15300
|
-
bags: data.
|
|
15301
|
-
shoes: data.
|
|
15302
|
-
apparel: data.
|
|
15303
|
-
accessories: data.
|
|
15304
|
-
watches: data.
|
|
15305
|
-
accessoriesCategories: data.
|
|
15306
|
-
apparelStyles: data.
|
|
15308
|
+
latestArrivals: data.latest_arrivals,
|
|
15309
|
+
bags: data.bags,
|
|
15310
|
+
shoes: data.shoes,
|
|
15311
|
+
apparel: data.apparel,
|
|
15312
|
+
accessories: data.accessories,
|
|
15313
|
+
watches: data.watches,
|
|
15314
|
+
accessoriesCategories: data.accessories_categories,
|
|
15315
|
+
apparelStyles: data.apparel_styles
|
|
15307
15316
|
});
|
|
15308
15317
|
});
|
|
15309
15318
|
}).catch(function () {
|
|
15310
15319
|
return setHasError(true);
|
|
15311
15320
|
});
|
|
15312
|
-
}, [
|
|
15321
|
+
}, [menuData]);
|
|
15313
15322
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
15314
15323
|
className: "side-nav"
|
|
15315
15324
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -15477,7 +15486,7 @@
|
|
|
15477
15486
|
backIcon: backIcon,
|
|
15478
15487
|
subMenuCategoryTitle: "Department",
|
|
15479
15488
|
productUrl: productUrl,
|
|
15480
|
-
categoryElements: categoryElements,
|
|
15489
|
+
categoryElements: addCategoryToElements(categoryElements, categories$1.bags.slug),
|
|
15481
15490
|
subMenuBrandsTitle: "Bag Brands",
|
|
15482
15491
|
brandsList: dropdownData.bags,
|
|
15483
15492
|
categorySlug: displayedSubMenu,
|
|
@@ -15489,7 +15498,7 @@
|
|
|
15489
15498
|
backIcon: backIcon,
|
|
15490
15499
|
subMenuCategoryTitle: "Department",
|
|
15491
15500
|
productUrl: productUrl,
|
|
15492
|
-
categoryElements: categoryElements,
|
|
15501
|
+
categoryElements: addCategoryToElements(categoryElements, categories$1.shoes.slug),
|
|
15493
15502
|
subMenuBrandsTitle: "Shoe Brands",
|
|
15494
15503
|
brandsList: dropdownData.shoes,
|
|
15495
15504
|
categorySlug: displayedSubMenu,
|
|
@@ -15501,7 +15510,7 @@
|
|
|
15501
15510
|
backIcon: backIcon,
|
|
15502
15511
|
subMenuCategoryTitle: "Department",
|
|
15503
15512
|
productUrl: productUrl,
|
|
15504
|
-
categoryElements: dropdownData.apparelStyles,
|
|
15513
|
+
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories$1.clothing.slug),
|
|
15505
15514
|
subMenuBrandsTitle: "Clothing Brands",
|
|
15506
15515
|
brandsList: dropdownData.apparel,
|
|
15507
15516
|
categorySlug: displayedSubMenu,
|
|
@@ -15525,7 +15534,7 @@
|
|
|
15525
15534
|
backIcon: backIcon,
|
|
15526
15535
|
subMenuCategoryTitle: "Department",
|
|
15527
15536
|
productUrl: productUrl,
|
|
15528
|
-
categoryElements: categoryElements,
|
|
15537
|
+
categoryElements: addCategoryToElements(categoryElements, categories$1.watches.slug),
|
|
15529
15538
|
subMenuBrandsTitle: "Watches Brands",
|
|
15530
15539
|
brandsList: dropdownData.watches,
|
|
15531
15540
|
categorySlug: displayedSubMenu,
|
|
@@ -15742,6 +15751,7 @@
|
|
|
15742
15751
|
onLogoClick = _ref.onLogoClick,
|
|
15743
15752
|
onLuxityShopClick = _ref.onLuxityShopClick,
|
|
15744
15753
|
endpoint = _ref.endpoint,
|
|
15754
|
+
menuData = _ref.menuData,
|
|
15745
15755
|
onSearchSubmit = _ref.onSearchSubmit,
|
|
15746
15756
|
onProductIdsReceived = _ref.onProductIdsReceived,
|
|
15747
15757
|
onLogoutClick = _ref.onLogoutClick,
|
|
@@ -16001,7 +16011,8 @@
|
|
|
16001
16011
|
categoryElements: categoryElements,
|
|
16002
16012
|
showSideNav: showSideNav,
|
|
16003
16013
|
onMenuClick: onMenuClick,
|
|
16004
|
-
endpoint: endpoint
|
|
16014
|
+
endpoint: endpoint,
|
|
16015
|
+
menuData: menuData
|
|
16005
16016
|
}), app && /*#__PURE__*/React__default.createElement(LuxityAppSideNav, {
|
|
16006
16017
|
accordionIcon: accordionIcon,
|
|
16007
16018
|
closeIcon: closeIcon,
|
package/package.json
CHANGED
package/build/.gitignore
DELETED
package/build/.npmignore
DELETED
|
File without changes
|