@bonlineza/luxity-lib 2.31.5 → 2.32.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 +5 -4
- package/LuxityDesktopHeader.js +107 -36
- package/LuxityGraphQLDropdownSelector.js +5 -4
- package/LuxityMobileHeader.js +146 -56
- package/LuxitySideNav.js +143 -39
- package/MaterialSelector.js +5 -4
- package/ModelSelector.js +5 -4
- package/build/.gitignore +3 -0
- package/build/.npmignore +0 -0
- package/build/bundle.css +1 -1
- package/build/bundle.js +193 -88
- package/package.json +1 -1
package/build/bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-animate-height'), require('styled-components'), require('numeral'), require('@bonlineza/b-lib/EllipsisLoader'), require('@bonlineza/b-lib/PageReady'), require('stylis-rule-sheet'), require('react-dom'), require('prop-types'), require('raf'), require('react-input-autosize'), require('react-transition-group'), require('@bonlineza/b-lib/functions'), require('rc-slider'), require('react-notify-toast')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-animate-height', 'styled-components', 'numeral', '@bonlineza/b-lib/EllipsisLoader', '@bonlineza/b-lib/PageReady', 'stylis-rule-sheet', 'react-dom', 'prop-types', 'raf', 'react-input-autosize', 'react-transition-group', '@bonlineza/b-lib/functions', 'rc-slider', 'react-notify-toast'], factory) :
|
|
4
|
-
(global = global || self, factory(global.blib = {}, global.React, global.AnimateHeight, global.styled, global.numeral, global.EllipsisLoader, global.PageReady, global['stylis-rule-sheet'], global.reactDom, global.PropTypes, global.raf, global['react-input-autosize'], global['react-transition-group'], global.function, global.rcSlider, global['react-notify-toast']));
|
|
5
|
-
}(this, (function (exports, React, AnimateHeight, styled, numeral, EllipsisLoader, PageReady, stylisRuleSheet, reactDom, PropTypes, raf, AutosizeInput, reactTransitionGroup, functions, rcSlider, Notifications) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-animate-height'), require('styled-components'), require('numeral'), require('@bonlineza/b-lib/EllipsisLoader'), require('@bonlineza/b-lib/PageReady'), require('stylis-rule-sheet'), require('react-dom'), require('prop-types'), require('raf'), require('react-input-autosize'), require('react-transition-group'), require('@bonlineza/b-lib/functions'), require('rc-slider'), require('react-notify-toast'), require('axios')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-animate-height', 'styled-components', 'numeral', '@bonlineza/b-lib/EllipsisLoader', '@bonlineza/b-lib/PageReady', 'stylis-rule-sheet', 'react-dom', 'prop-types', 'raf', 'react-input-autosize', 'react-transition-group', '@bonlineza/b-lib/functions', 'rc-slider', 'react-notify-toast', 'axios'], factory) :
|
|
4
|
+
(global = global || self, factory(global.blib = {}, global.React, global.AnimateHeight, global.styled, global.numeral, global.EllipsisLoader, global.PageReady, global['stylis-rule-sheet'], global.reactDom, global.PropTypes, global.raf, global['react-input-autosize'], global['react-transition-group'], global.function, global.rcSlider, global['react-notify-toast'], global.axios));
|
|
5
|
+
}(this, (function (exports, React, AnimateHeight, styled, numeral, EllipsisLoader, PageReady, stylisRuleSheet, reactDom, PropTypes, raf, AutosizeInput, reactTransitionGroup, functions, rcSlider, Notifications, axios) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var React__default = 'default' in React ? React['default'] : React;
|
|
8
8
|
AnimateHeight = AnimateHeight && Object.prototype.hasOwnProperty.call(AnimateHeight, 'default') ? AnimateHeight['default'] : AnimateHeight;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
raf = raf && Object.prototype.hasOwnProperty.call(raf, 'default') ? raf['default'] : raf;
|
|
16
16
|
AutosizeInput = AutosizeInput && Object.prototype.hasOwnProperty.call(AutosizeInput, 'default') ? AutosizeInput['default'] : AutosizeInput;
|
|
17
17
|
var Notifications__default = 'default' in Notifications ? Notifications['default'] : Notifications;
|
|
18
|
+
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
18
19
|
|
|
19
20
|
function ownKeys(object, enumerableOnly) {
|
|
20
21
|
var keys = Object.keys(object);
|
|
@@ -14399,6 +14400,12 @@
|
|
|
14399
14400
|
|
|
14400
14401
|
var index$6 = themed(LuxityFooter);
|
|
14401
14402
|
|
|
14403
|
+
var getBrands = function getBrands() {
|
|
14404
|
+
return {
|
|
14405
|
+
query: "{\n latest_arrivals: luxity_brands(has_products: true, limit: 1000, page: 1) {data {id name slug}}\n bags: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: BAGS) {data {id name slug}}\n shoes: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: SHOES) {data {id name slug}}\n apparel: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: APPAREL) {data {id name slug}}\n accessories: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: ACCESSORIES) {data {id name slug}}\n watches: luxity_brands(has_products: true, limit: 1000, page: 1, category_type: WATCHES) {data {id name slug}}\n accessories_categories: luxity_accessories_categories_list { id name slug }\n apparel_styles: luxity_apparel_styles_list { name slug }\n } "
|
|
14406
|
+
};
|
|
14407
|
+
};
|
|
14408
|
+
|
|
14402
14409
|
var Dropdown$1 = function Dropdown(_ref) {
|
|
14403
14410
|
var title = _ref.title,
|
|
14404
14411
|
imageSrc = _ref.imageSrc,
|
|
@@ -14408,10 +14415,16 @@
|
|
|
14408
14415
|
brandElements = _ref$brandElements === void 0 ? [] : _ref$brandElements,
|
|
14409
14416
|
productsUrl = _ref.productsUrl,
|
|
14410
14417
|
categorySlug = _ref.categorySlug,
|
|
14411
|
-
categoryTitle = _ref.categoryTitle
|
|
14412
|
-
|
|
14418
|
+
categoryTitle = _ref.categoryTitle,
|
|
14419
|
+
isLoading = _ref.isLoading,
|
|
14420
|
+
hasError = _ref.hasError;
|
|
14421
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, hasError ? /*#__PURE__*/React__default.createElement("div", {
|
|
14422
|
+
className: "dropdown__errors"
|
|
14423
|
+
}, "Failed to load data.") : /*#__PURE__*/React__default.createElement("div", {
|
|
14413
14424
|
className: "dropdown"
|
|
14414
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14425
|
+
}, isLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
14426
|
+
className: "cover-spinner"
|
|
14427
|
+
}) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
14415
14428
|
className: "dropdown__column"
|
|
14416
14429
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14417
14430
|
className: "dropdown__title"
|
|
@@ -14422,11 +14435,11 @@
|
|
|
14422
14435
|
href: "".concat(productsUrl, "/").concat(categoryElement.category, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
14423
14436
|
className: "dropdown__element",
|
|
14424
14437
|
key: categoryElement.name
|
|
14425
|
-
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name) : /*#__PURE__*/React__default.createElement("a", {
|
|
14438
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase()) : /*#__PURE__*/React__default.createElement("a", {
|
|
14426
14439
|
href: "".concat(productsUrl, "/").concat(categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.slug),
|
|
14427
14440
|
className: "dropdown__element",
|
|
14428
14441
|
key: categoryElement.name
|
|
14429
|
-
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name);
|
|
14442
|
+
}, categoryElement === null || categoryElement === void 0 ? void 0 : categoryElement.name.toLowerCase());
|
|
14430
14443
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
14431
14444
|
className: "dropdown__column"
|
|
14432
14445
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -14447,7 +14460,7 @@
|
|
|
14447
14460
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
14448
14461
|
src: imageSrc,
|
|
14449
14462
|
alt: "".concat(title)
|
|
14450
|
-
})));
|
|
14463
|
+
})))));
|
|
14451
14464
|
};
|
|
14452
14465
|
|
|
14453
14466
|
var StoresDropdown = function StoresDropdown(_ref) {
|
|
@@ -14516,6 +14529,14 @@
|
|
|
14516
14529
|
}
|
|
14517
14530
|
};
|
|
14518
14531
|
|
|
14532
|
+
var removeCategoryByName = function removeCategoryByName(categories, name) {
|
|
14533
|
+
var _categories$filter;
|
|
14534
|
+
|
|
14535
|
+
return (_categories$filter = categories === null || categories === void 0 ? void 0 : categories.filter(function (category) {
|
|
14536
|
+
return category.name !== name;
|
|
14537
|
+
})) !== null && _categories$filter !== void 0 ? _categories$filter : [];
|
|
14538
|
+
};
|
|
14539
|
+
|
|
14519
14540
|
var LuxityDesktopHeader = function LuxityDesktopHeader(_ref) {
|
|
14520
14541
|
var accountIcon = _ref.accountIcon,
|
|
14521
14542
|
cartIcon = _ref.cartIcon,
|
|
@@ -14523,39 +14544,56 @@
|
|
|
14523
14544
|
cartCount = _ref.cartCount,
|
|
14524
14545
|
logoSrc = _ref.logoSrc,
|
|
14525
14546
|
categoryElements = _ref.categoryElements,
|
|
14526
|
-
newBrandElements = _ref.newBrandElements,
|
|
14527
|
-
bagsElements = _ref.bagsElements,
|
|
14528
|
-
shoesElements = _ref.shoesElements,
|
|
14529
|
-
clothingElements = _ref.clothingElements,
|
|
14530
|
-
accessoriesElements = _ref.accessoriesElements,
|
|
14531
|
-
accessoriesCategoryElements = _ref.accessoriesCategoryElements,
|
|
14532
|
-
apparelStylesElements = _ref.apparelStylesElements,
|
|
14533
|
-
watchesElements = _ref.watchesElements,
|
|
14534
14547
|
newBrandsImage = _ref.newBrandsImage,
|
|
14535
14548
|
bagsImage = _ref.bagsImage,
|
|
14536
14549
|
shoesImage = _ref.shoesImage,
|
|
14537
14550
|
clothingImage = _ref.clothingImage,
|
|
14538
14551
|
accessoriesImage = _ref.accessoriesImage,
|
|
14539
14552
|
watchesImage = _ref.watchesImage,
|
|
14540
|
-
productsUrl = _ref.productsUrl,
|
|
14541
14553
|
stores = _ref.stores,
|
|
14542
14554
|
contactNumber = _ref.contactNumber,
|
|
14555
|
+
productsUrl = _ref.productsUrl,
|
|
14543
14556
|
onInterestClick = _ref.onInterestClick,
|
|
14544
14557
|
onCartClick = _ref.onCartClick,
|
|
14545
14558
|
onAccountClick = _ref.onAccountClick,
|
|
14546
14559
|
inputSearchIcon = _ref.inputSearchIcon,
|
|
14547
14560
|
onSearch = _ref.onSearch,
|
|
14548
|
-
|
|
14561
|
+
onSellToUsClick = _ref.onSellToUsClick,
|
|
14549
14562
|
blogLink = _ref.blogLink,
|
|
14550
14563
|
contactUsLink = _ref.contactUsLink,
|
|
14551
|
-
|
|
14552
|
-
onLogoClick = _ref.onLogoClick
|
|
14564
|
+
ourStoryLink = _ref.ourStoryLink,
|
|
14565
|
+
onLogoClick = _ref.onLogoClick,
|
|
14566
|
+
endpoint = _ref.endpoint;
|
|
14553
14567
|
|
|
14554
14568
|
var _useState = React.useState(''),
|
|
14555
14569
|
_useState2 = _slicedToArray(_useState, 2),
|
|
14556
14570
|
searchValue = _useState2[0],
|
|
14557
14571
|
setSearchValue = _useState2[1];
|
|
14558
14572
|
|
|
14573
|
+
var _useState3 = React.useState(false),
|
|
14574
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14575
|
+
loading = _useState4[0],
|
|
14576
|
+
setLoading = _useState4[1];
|
|
14577
|
+
|
|
14578
|
+
var _useState5 = React.useState({
|
|
14579
|
+
latestArrivals: [],
|
|
14580
|
+
bags: [],
|
|
14581
|
+
shoes: [],
|
|
14582
|
+
clothing: [],
|
|
14583
|
+
accessories: [],
|
|
14584
|
+
watches: [],
|
|
14585
|
+
accessoriesCategories: [],
|
|
14586
|
+
apparelStyles: []
|
|
14587
|
+
}),
|
|
14588
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
14589
|
+
dropdownData = _useState6[0],
|
|
14590
|
+
setDropdownData = _useState6[1];
|
|
14591
|
+
|
|
14592
|
+
var _useState7 = React.useState(false),
|
|
14593
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
14594
|
+
hasError = _useState8[0],
|
|
14595
|
+
setHasError = _useState8[1];
|
|
14596
|
+
|
|
14559
14597
|
var handleChange = function handleChange(event) {
|
|
14560
14598
|
setSearchValue(event.target.value);
|
|
14561
14599
|
};
|
|
@@ -14574,6 +14612,27 @@
|
|
|
14574
14612
|
});
|
|
14575
14613
|
}
|
|
14576
14614
|
|
|
14615
|
+
React.useMemo(function () {
|
|
14616
|
+
setLoading(true);
|
|
14617
|
+
axios.post("".concat(endpoint), getBrands()).then(function (_ref2) {
|
|
14618
|
+
var data = _ref2.data;
|
|
14619
|
+
setLoading(false);
|
|
14620
|
+
setDropdownData(function (prev) {
|
|
14621
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
14622
|
+
latestArrivals: data.data.latest_arrivals.data,
|
|
14623
|
+
bags: data.data.bags.data,
|
|
14624
|
+
shoes: data.data.shoes.data,
|
|
14625
|
+
apparel: data.data.apparel.data,
|
|
14626
|
+
accessories: data.data.accessories.data,
|
|
14627
|
+
watches: data.data.watches.data,
|
|
14628
|
+
accessoriesCategories: data.data.accessories_categories,
|
|
14629
|
+
apparelStyles: data.data.apparel_styles
|
|
14630
|
+
});
|
|
14631
|
+
});
|
|
14632
|
+
}).catch(function () {
|
|
14633
|
+
return setHasError(true);
|
|
14634
|
+
});
|
|
14635
|
+
}, [endpoint]);
|
|
14577
14636
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
14578
14637
|
className: "navbar"
|
|
14579
14638
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -14617,10 +14676,12 @@
|
|
|
14617
14676
|
title: "Department",
|
|
14618
14677
|
imageSrc: newBrandsImage,
|
|
14619
14678
|
categoryElements: categoryElements,
|
|
14620
|
-
brandElements:
|
|
14679
|
+
brandElements: dropdownData.latestArrivals,
|
|
14621
14680
|
productsUrl: productsUrl,
|
|
14622
14681
|
categorySlug: "brands",
|
|
14623
|
-
categoryTitle: "Brands"
|
|
14682
|
+
categoryTitle: "Brands",
|
|
14683
|
+
isLoading: loading,
|
|
14684
|
+
hasError: hasError
|
|
14624
14685
|
}))), /*#__PURE__*/React__default.createElement("li", {
|
|
14625
14686
|
className: "navbar__link"
|
|
14626
14687
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -14632,10 +14693,12 @@
|
|
|
14632
14693
|
title: "Department",
|
|
14633
14694
|
imageSrc: bagsImage,
|
|
14634
14695
|
categoryElements: addCategoryToElements(categoryElements, categories$1.bags.slug),
|
|
14635
|
-
brandElements:
|
|
14696
|
+
brandElements: dropdownData.bags,
|
|
14636
14697
|
productsUrl: productsUrl,
|
|
14637
14698
|
categorySlug: categories$1.bags.slug,
|
|
14638
|
-
categoryTitle: categories$1.bags.name
|
|
14699
|
+
categoryTitle: categories$1.bags.name,
|
|
14700
|
+
isLoading: loading,
|
|
14701
|
+
hasError: hasError
|
|
14639
14702
|
}))), /*#__PURE__*/React__default.createElement("li", {
|
|
14640
14703
|
className: "navbar__link"
|
|
14641
14704
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -14647,10 +14710,12 @@
|
|
|
14647
14710
|
title: "Department",
|
|
14648
14711
|
imageSrc: shoesImage,
|
|
14649
14712
|
categoryElements: addCategoryToElements(categoryElements, categories$1.shoes.slug),
|
|
14650
|
-
brandElements:
|
|
14713
|
+
brandElements: dropdownData.shoes,
|
|
14651
14714
|
productsUrl: productsUrl,
|
|
14652
14715
|
categorySlug: categories$1.shoes.slug,
|
|
14653
|
-
categoryTitle: categories$1.shoes.name
|
|
14716
|
+
categoryTitle: categories$1.shoes.name,
|
|
14717
|
+
isLoading: loading,
|
|
14718
|
+
hasError: hasError
|
|
14654
14719
|
}))), /*#__PURE__*/React__default.createElement("li", {
|
|
14655
14720
|
className: "navbar__link"
|
|
14656
14721
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -14661,11 +14726,13 @@
|
|
|
14661
14726
|
}, /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
14662
14727
|
title: "Department",
|
|
14663
14728
|
imageSrc: clothingImage,
|
|
14664
|
-
categoryElements:
|
|
14665
|
-
brandElements:
|
|
14729
|
+
categoryElements: dropdownData.apparelStyles,
|
|
14730
|
+
brandElements: dropdownData.apparel,
|
|
14666
14731
|
productsUrl: productsUrl,
|
|
14667
14732
|
categorySlug: categories$1.clothing.slug,
|
|
14668
|
-
categoryTitle: categories$1.clothing.name
|
|
14733
|
+
categoryTitle: categories$1.clothing.name,
|
|
14734
|
+
isLoading: loading,
|
|
14735
|
+
hasError: hasError
|
|
14669
14736
|
}))), /*#__PURE__*/React__default.createElement("li", {
|
|
14670
14737
|
className: "navbar__link"
|
|
14671
14738
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -14676,11 +14743,13 @@
|
|
|
14676
14743
|
}, /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
14677
14744
|
title: "Categories",
|
|
14678
14745
|
imageSrc: accessoriesImage,
|
|
14679
|
-
categoryElements:
|
|
14680
|
-
brandElements:
|
|
14746
|
+
categoryElements: removeCategoryByName(dropdownData.accessoriesCategories, 'ACCESSORIES'),
|
|
14747
|
+
brandElements: dropdownData.accessories,
|
|
14681
14748
|
productsUrl: productsUrl,
|
|
14682
14749
|
categorySlug: categories$1.accessories.slug,
|
|
14683
|
-
categoryTitle: categories$1.accessories.name
|
|
14750
|
+
categoryTitle: categories$1.accessories.name,
|
|
14751
|
+
isLoading: loading,
|
|
14752
|
+
hasError: hasError
|
|
14684
14753
|
}))), /*#__PURE__*/React__default.createElement("li", {
|
|
14685
14754
|
className: "navbar__link"
|
|
14686
14755
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -14692,10 +14761,12 @@
|
|
|
14692
14761
|
title: "Department",
|
|
14693
14762
|
imageSrc: watchesImage,
|
|
14694
14763
|
categoryElements: addCategoryToElements(categoryElements, categories$1.watches.slug),
|
|
14695
|
-
brandElements:
|
|
14764
|
+
brandElements: dropdownData.watches,
|
|
14696
14765
|
productsUrl: productsUrl,
|
|
14697
14766
|
categorySlug: categories$1.watches.slug,
|
|
14698
|
-
categoryTitle: categories$1.watches.name
|
|
14767
|
+
categoryTitle: categories$1.watches.name,
|
|
14768
|
+
isLoading: loading,
|
|
14769
|
+
hasError: hasError
|
|
14699
14770
|
}))), /*#__PURE__*/React__default.createElement("li", {
|
|
14700
14771
|
className: "navbar__link"
|
|
14701
14772
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -14810,12 +14881,18 @@
|
|
|
14810
14881
|
subMenuBrandsTitle = _ref.subMenuBrandsTitle,
|
|
14811
14882
|
_ref$brandsList = _ref.brandsList,
|
|
14812
14883
|
brandsList = _ref$brandsList === void 0 ? [] : _ref$brandsList,
|
|
14813
|
-
categorySlug = _ref.categorySlug
|
|
14884
|
+
categorySlug = _ref.categorySlug,
|
|
14885
|
+
isLoading = _ref.isLoading,
|
|
14886
|
+
hasError = _ref.hasError;
|
|
14814
14887
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
14815
14888
|
className: "side-nav__content ".concat(subMenuOpen ? '' : 'side-nav__content--hidden')
|
|
14816
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14889
|
+
}, hasError ? /*#__PURE__*/React__default.createElement("div", {
|
|
14890
|
+
className: "side-nav__errors"
|
|
14891
|
+
}, "Failed to load data.") : /*#__PURE__*/React__default.createElement("div", {
|
|
14817
14892
|
className: "side-nav__sub-menu-wrapper"
|
|
14818
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14893
|
+
}, isLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
14894
|
+
className: "cover-spinner"
|
|
14895
|
+
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
14819
14896
|
className: "side-nav__sub-menu"
|
|
14820
14897
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
14821
14898
|
type: "button",
|
|
@@ -14835,7 +14912,7 @@
|
|
|
14835
14912
|
return /*#__PURE__*/React__default.createElement("a", {
|
|
14836
14913
|
href: "".concat(productUrl, "/").concat(category.slug),
|
|
14837
14914
|
className: "side-nav__element"
|
|
14838
|
-
}, category.name);
|
|
14915
|
+
}, category.name.toLowerCase());
|
|
14839
14916
|
})), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
14840
14917
|
className: "side-nav__elements"
|
|
14841
14918
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -14864,24 +14941,9 @@
|
|
|
14864
14941
|
onSellToUsClick = _ref.onSellToUsClick,
|
|
14865
14942
|
stores = _ref.stores,
|
|
14866
14943
|
categoryElements = _ref.categoryElements,
|
|
14867
|
-
_ref$newBrandsList = _ref.newBrandsList,
|
|
14868
|
-
newBrandsList = _ref$newBrandsList === void 0 ? [] : _ref$newBrandsList,
|
|
14869
|
-
_ref$bagsBrandsList = _ref.bagsBrandsList,
|
|
14870
|
-
bagsBrandsList = _ref$bagsBrandsList === void 0 ? [] : _ref$bagsBrandsList,
|
|
14871
|
-
_ref$shoesBrandsList = _ref.shoesBrandsList,
|
|
14872
|
-
shoesBrandsList = _ref$shoesBrandsList === void 0 ? [] : _ref$shoesBrandsList,
|
|
14873
|
-
_ref$clothingBrandsLi = _ref.clothingBrandsList,
|
|
14874
|
-
clothingBrandsList = _ref$clothingBrandsLi === void 0 ? [] : _ref$clothingBrandsLi,
|
|
14875
|
-
_ref$accessoriesBrand = _ref.accessoriesBrandsList,
|
|
14876
|
-
accessoriesBrandsList = _ref$accessoriesBrand === void 0 ? [] : _ref$accessoriesBrand,
|
|
14877
|
-
_ref$watchesBrandsLis = _ref.watchesBrandsList,
|
|
14878
|
-
watchesBrandsList = _ref$watchesBrandsLis === void 0 ? [] : _ref$watchesBrandsLis,
|
|
14879
|
-
_ref$accessoriesCateg = _ref.accessoriesCategoryElements,
|
|
14880
|
-
accessoriesCategoryElements = _ref$accessoriesCateg === void 0 ? [] : _ref$accessoriesCateg,
|
|
14881
|
-
_ref$apparelStylesEle = _ref.apparelStylesElements,
|
|
14882
|
-
apparelStylesElements = _ref$apparelStylesEle === void 0 ? [] : _ref$apparelStylesEle,
|
|
14883
14944
|
showSideNav = _ref.showSideNav,
|
|
14884
|
-
onMenuClick = _ref.onMenuClick
|
|
14945
|
+
onMenuClick = _ref.onMenuClick,
|
|
14946
|
+
endpoint = _ref.endpoint;
|
|
14885
14947
|
|
|
14886
14948
|
var _useState = React.useState(false),
|
|
14887
14949
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -14893,6 +14955,30 @@
|
|
|
14893
14955
|
displayedSubMenu = _useState4[0],
|
|
14894
14956
|
setDisplayedSubMenu = _useState4[1];
|
|
14895
14957
|
|
|
14958
|
+
var _useState5 = React.useState(false),
|
|
14959
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
14960
|
+
loading = _useState6[0],
|
|
14961
|
+
setLoading = _useState6[1];
|
|
14962
|
+
|
|
14963
|
+
var _useState7 = React.useState({
|
|
14964
|
+
latestArrivals: [],
|
|
14965
|
+
bags: [],
|
|
14966
|
+
shoes: [],
|
|
14967
|
+
clothing: [],
|
|
14968
|
+
accessories: [],
|
|
14969
|
+
watches: [],
|
|
14970
|
+
accessoriesCategories: [],
|
|
14971
|
+
apparelStyles: []
|
|
14972
|
+
}),
|
|
14973
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
14974
|
+
dropdownData = _useState8[0],
|
|
14975
|
+
setDropdownData = _useState8[1];
|
|
14976
|
+
|
|
14977
|
+
var _useState9 = React.useState(false),
|
|
14978
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
14979
|
+
hasError = _useState10[0],
|
|
14980
|
+
setHasError = _useState10[1];
|
|
14981
|
+
|
|
14896
14982
|
var onSubMenuClick = function onSubMenuClick(subMenu) {
|
|
14897
14983
|
setSubMenuOpen(function (prev) {
|
|
14898
14984
|
return !prev;
|
|
@@ -14910,6 +14996,27 @@
|
|
|
14910
14996
|
setDisplayedSubMenu('');
|
|
14911
14997
|
};
|
|
14912
14998
|
|
|
14999
|
+
React.useMemo(function () {
|
|
15000
|
+
setLoading(true);
|
|
15001
|
+
axios.post("".concat(endpoint), getBrands()).then(function (_ref2) {
|
|
15002
|
+
var data = _ref2.data;
|
|
15003
|
+
setLoading(false);
|
|
15004
|
+
setDropdownData(function (prev) {
|
|
15005
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
15006
|
+
latestArrivals: data.data.latest_arrivals.data,
|
|
15007
|
+
bags: data.data.bags.data,
|
|
15008
|
+
shoes: data.data.shoes.data,
|
|
15009
|
+
apparel: data.data.apparel.data,
|
|
15010
|
+
accessories: data.data.accessories.data,
|
|
15011
|
+
watches: data.data.watches.data,
|
|
15012
|
+
accessoriesCategories: data.data.accessories_categories,
|
|
15013
|
+
apparelStyles: data.data.apparel_styles
|
|
15014
|
+
});
|
|
15015
|
+
});
|
|
15016
|
+
}).catch(function () {
|
|
15017
|
+
return setHasError(true);
|
|
15018
|
+
});
|
|
15019
|
+
}, [endpoint]);
|
|
14913
15020
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
14914
15021
|
className: "side-nav"
|
|
14915
15022
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -15063,8 +15170,10 @@
|
|
|
15063
15170
|
productUrl: productUrl,
|
|
15064
15171
|
categoryElements: categoryElements,
|
|
15065
15172
|
subMenuBrandsTitle: "Brands",
|
|
15066
|
-
brandsList:
|
|
15067
|
-
categorySlug: displayedSubMenu
|
|
15173
|
+
brandsList: dropdownData.latestArrivals,
|
|
15174
|
+
categorySlug: displayedSubMenu,
|
|
15175
|
+
isLoading: loading,
|
|
15176
|
+
hasError: hasError
|
|
15068
15177
|
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
15069
15178
|
subMenuOpen: subMenuOpen && displayedSubMenu === 'bags',
|
|
15070
15179
|
onBackClick: onBackClick,
|
|
@@ -15073,8 +15182,10 @@
|
|
|
15073
15182
|
productUrl: productUrl,
|
|
15074
15183
|
categoryElements: categoryElements,
|
|
15075
15184
|
subMenuBrandsTitle: "Bag Brands",
|
|
15076
|
-
brandsList:
|
|
15077
|
-
categorySlug: displayedSubMenu
|
|
15185
|
+
brandsList: dropdownData.bags,
|
|
15186
|
+
categorySlug: displayedSubMenu,
|
|
15187
|
+
isLoading: loading,
|
|
15188
|
+
hasError: hasError
|
|
15078
15189
|
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
15079
15190
|
subMenuOpen: subMenuOpen && displayedSubMenu === 'shoes',
|
|
15080
15191
|
onBackClick: onBackClick,
|
|
@@ -15083,28 +15194,34 @@
|
|
|
15083
15194
|
productUrl: productUrl,
|
|
15084
15195
|
categoryElements: categoryElements,
|
|
15085
15196
|
subMenuBrandsTitle: "Shoe Brands",
|
|
15086
|
-
brandsList:
|
|
15087
|
-
categorySlug: displayedSubMenu
|
|
15197
|
+
brandsList: dropdownData.shoes,
|
|
15198
|
+
categorySlug: displayedSubMenu,
|
|
15199
|
+
isLoading: loading,
|
|
15200
|
+
hasError: hasError
|
|
15088
15201
|
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
15089
15202
|
subMenuOpen: subMenuOpen && displayedSubMenu === 'clothing',
|
|
15090
15203
|
onBackClick: onBackClick,
|
|
15091
15204
|
backIcon: backIcon,
|
|
15092
15205
|
subMenuCategoryTitle: "Department",
|
|
15093
15206
|
productUrl: productUrl,
|
|
15094
|
-
categoryElements:
|
|
15207
|
+
categoryElements: dropdownData.apparelStyles,
|
|
15095
15208
|
subMenuBrandsTitle: "Clothing Brands",
|
|
15096
|
-
brandsList:
|
|
15097
|
-
categorySlug: displayedSubMenu
|
|
15209
|
+
brandsList: dropdownData.clothing,
|
|
15210
|
+
categorySlug: displayedSubMenu,
|
|
15211
|
+
isLoading: loading,
|
|
15212
|
+
hasError: hasError
|
|
15098
15213
|
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
15099
15214
|
subMenuOpen: subMenuOpen && displayedSubMenu === 'accessories',
|
|
15100
15215
|
onBackClick: onBackClick,
|
|
15101
15216
|
backIcon: backIcon,
|
|
15102
15217
|
subMenuCategoryTitle: "Categories",
|
|
15103
15218
|
productUrl: productUrl,
|
|
15104
|
-
categoryElements:
|
|
15219
|
+
categoryElements: removeCategoryByName(dropdownData.accessoriesCategories, 'ACCESSORIES'),
|
|
15105
15220
|
subMenuBrandsTitle: "Accessory Brands",
|
|
15106
|
-
brandsList:
|
|
15107
|
-
categorySlug: displayedSubMenu
|
|
15221
|
+
brandsList: dropdownData.accessories,
|
|
15222
|
+
categorySlug: displayedSubMenu,
|
|
15223
|
+
isLoading: loading,
|
|
15224
|
+
hasError: hasError
|
|
15108
15225
|
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
15109
15226
|
subMenuOpen: subMenuOpen && displayedSubMenu === 'watches',
|
|
15110
15227
|
onBackClick: onBackClick,
|
|
@@ -15113,8 +15230,10 @@
|
|
|
15113
15230
|
productUrl: productUrl,
|
|
15114
15231
|
categoryElements: categoryElements,
|
|
15115
15232
|
subMenuBrandsTitle: "Watches Brands",
|
|
15116
|
-
brandsList:
|
|
15117
|
-
categorySlug: displayedSubMenu
|
|
15233
|
+
brandsList: dropdownData.watches,
|
|
15234
|
+
categorySlug: displayedSubMenu,
|
|
15235
|
+
isLoading: loading,
|
|
15236
|
+
hasError: hasError
|
|
15118
15237
|
}), displayedSubMenu === 'stores' && /*#__PURE__*/React__default.createElement("div", {
|
|
15119
15238
|
className: "side-nav__content"
|
|
15120
15239
|
}, /*#__PURE__*/React__default.createElement(StoresDropdown$1, {
|
|
@@ -15144,15 +15263,8 @@
|
|
|
15144
15263
|
ourStoryLink = _ref.ourStoryLink,
|
|
15145
15264
|
blogLink = _ref.blogLink,
|
|
15146
15265
|
onSellToUsClick = _ref.onSellToUsClick,
|
|
15147
|
-
|
|
15148
|
-
|
|
15149
|
-
shoesBrandsList = _ref.shoesBrandsList,
|
|
15150
|
-
clothingBrandsList = _ref.clothingBrandsList,
|
|
15151
|
-
accessoriesBrandsList = _ref.accessoriesBrandsList,
|
|
15152
|
-
accessoriesCategoryElements = _ref.accessoriesCategoryElements,
|
|
15153
|
-
apparelStylesElements = _ref.apparelStylesElements,
|
|
15154
|
-
watchesBrandsList = _ref.watchesBrandsList,
|
|
15155
|
-
onLogoClick = _ref.onLogoClick;
|
|
15266
|
+
onLogoClick = _ref.onLogoClick,
|
|
15267
|
+
endpoint = _ref.endpoint;
|
|
15156
15268
|
|
|
15157
15269
|
var _useState = React.useState(''),
|
|
15158
15270
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -15265,16 +15377,9 @@
|
|
|
15265
15377
|
onSellToUsClick: onSellToUsClick,
|
|
15266
15378
|
stores: stores,
|
|
15267
15379
|
categoryElements: categoryElements,
|
|
15268
|
-
newBrandsList: newBrandsList,
|
|
15269
|
-
bagsBrandsList: bagsBrandsList,
|
|
15270
|
-
shoesBrandsList: shoesBrandsList,
|
|
15271
|
-
clothingBrandsList: clothingBrandsList,
|
|
15272
|
-
accessoriesBrandsList: accessoriesBrandsList,
|
|
15273
|
-
watchesBrandsList: watchesBrandsList,
|
|
15274
15380
|
showSideNav: showSideNav,
|
|
15275
15381
|
onMenuClick: onMenuClick,
|
|
15276
|
-
|
|
15277
|
-
apparelStylesElements: apparelStylesElements
|
|
15382
|
+
endpoint: endpoint
|
|
15278
15383
|
}));
|
|
15279
15384
|
};
|
|
15280
15385
|
|