s-platform-landing-section 0.1.15 → 0.1.17

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.
@@ -211,7 +211,7 @@ var Options = function Options(props) {
211
211
  };
212
212
 
213
213
  var NavBar7 = function NavBar7(props) {
214
- var _routes$find, _routes$filter, _routes$filter2;
214
+ var _routes$find, _shopConfigStyle$navB, _shopConfigStyle$navB2, _shopConfigStyle$navB3, _shopConfigStyle$navB4;
215
215
  var _useState = useState(false),
216
216
  isOpen = _useState[0],
217
217
  setIsOpen = _useState[1];
@@ -257,17 +257,6 @@ var NavBar7 = function NavBar7(props) {
257
257
  className: "text-gray3"
258
258
  })
259
259
  }];
260
- useEffect(function () {
261
- if ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "cafe_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "grocery_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "fashion_1") {
262
- routes === null || routes === void 0 ? void 0 : routes.forEach(function (route) {
263
- if ((route === null || route === void 0 ? void 0 : route.name) === "home" || (route === null || route === void 0 ? void 0 : route.name) === "products" || (route === null || route === void 0 ? void 0 : route.name) === "about") {
264
- route.isShow = true;
265
- } else {
266
- route.isShow = false;
267
- }
268
- });
269
- }
270
- }, [shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode]);
271
260
  useEffect(function () {
272
261
  var totalItem = cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (total, item) {
273
262
  return total + (item === null || item === void 0 ? void 0 : item.quantity);
@@ -306,15 +295,15 @@ var NavBar7 = function NavBar7(props) {
306
295
  className: "text-xl md:text-2xl whitespace-nowrap font-semibold text-primary"
307
296
  }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
308
297
  className: "hidden lg:flex flex-1 items-center gap-4"
309
- }, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
298
+ }, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB === void 0 ? void 0 : (_shopConfigStyle$navB2 = _shopConfigStyle$navB.filter(function (e) {
310
299
  return e === null || e === void 0 ? void 0 : e.isShow;
311
- })) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (item, index) {
300
+ })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (item, index) {
312
301
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
313
302
  Link: Link,
314
303
  href: item === null || item === void 0 ? void 0 : item.route,
315
304
  key: index
316
305
  }, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
317
- className: "py-1 border-b text-textHeading border-textHeading"
306
+ className: "whitespace-nowrap py-1 border-b text-textHeading border-textHeading"
318
307
  }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
319
308
  className: "py-1 text-textBody"
320
309
  }, item === null || item === void 0 ? void 0 : item.label));
@@ -391,9 +380,9 @@ var NavBar7 = function NavBar7(props) {
391
380
  }
392
381
  }, /*#__PURE__*/React__default.createElement(RxCross2, {
393
382
  size: 24
394
- })), /*#__PURE__*/React__default.createElement("div", null, routes === null || routes === void 0 ? void 0 : (_routes$filter2 = routes.filter(function (e) {
383
+ })), /*#__PURE__*/React__default.createElement("div", null, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
395
384
  return e === null || e === void 0 ? void 0 : e.isShow;
396
- })) === null || _routes$filter2 === void 0 ? void 0 : _routes$filter2.map(function (item, index) {
385
+ })) === null || _shopConfigStyle$navB4 === void 0 ? void 0 : _shopConfigStyle$navB4.map(function (item, index) {
397
386
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
398
387
  Link: Link,
399
388
  href: item === null || item === void 0 ? void 0 : item.route,
@@ -405,7 +394,7 @@ var NavBar7 = function NavBar7(props) {
405
394
  };
406
395
 
407
396
  var NavBar1 = function NavBar1(props) {
408
- var _routes$find, _routes$filter, _routes$filter2;
397
+ var _routes$find, _shopConfigStyle$navB, _shopConfigStyle$navB2, _shopConfigStyle$navB3, _shopConfigStyle$navB4;
409
398
  var _useState = useState(false),
410
399
  isOpen = _useState[0],
411
400
  setIsOpen = _useState[1];
@@ -451,17 +440,6 @@ var NavBar1 = function NavBar1(props) {
451
440
  className: "text-gray3"
452
441
  })
453
442
  }];
454
- useEffect(function () {
455
- if ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "cafe_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "grocery_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "fashion_1") {
456
- routes === null || routes === void 0 ? void 0 : routes.forEach(function (route) {
457
- if ((route === null || route === void 0 ? void 0 : route.name) === "home" || (route === null || route === void 0 ? void 0 : route.name) === "products" || (route === null || route === void 0 ? void 0 : route.name) === "about") {
458
- route.isShow = true;
459
- } else {
460
- route.isShow = false;
461
- }
462
- });
463
- }
464
- }, [shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode]);
465
443
  useEffect(function () {
466
444
  var totalItem = cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (total, item) {
467
445
  return total + (item === null || item === void 0 ? void 0 : item.quantity);
@@ -519,15 +497,15 @@ var NavBar1 = function NavBar1(props) {
519
497
  className: "text-xl md:text-2xl whitespace-nowrap font-semibold text-primary"
520
498
  }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
521
499
  className: "hidden lg:flex flex-1 items-center gap-4"
522
- }, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
500
+ }, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB === void 0 ? void 0 : (_shopConfigStyle$navB2 = _shopConfigStyle$navB.filter(function (e) {
523
501
  return e === null || e === void 0 ? void 0 : e.isShow;
524
- })) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (item, index) {
502
+ })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (item, index) {
525
503
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
526
504
  Link: Link,
527
505
  href: item === null || item === void 0 ? void 0 : item.route,
528
506
  key: index
529
507
  }, /*#__PURE__*/React__default.createElement("div", {
530
- className: "py-1 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "border-b text-primary border-primary" : "text-textBody") + " "
508
+ className: "py-1 whitespace-nowrap " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "border-b text-primary border-primary" : "text-textBody") + " "
531
509
  }, item === null || item === void 0 ? void 0 : item.label));
532
510
  })), cart(), userInfo ?
533
511
  /*#__PURE__*/
@@ -611,9 +589,9 @@ var NavBar1 = function NavBar1(props) {
611
589
  }
612
590
  }, /*#__PURE__*/React__default.createElement(RxCross2, {
613
591
  size: 24
614
- }))), /*#__PURE__*/React__default.createElement("div", null, routes === null || routes === void 0 ? void 0 : (_routes$filter2 = routes.filter(function (e) {
592
+ }))), /*#__PURE__*/React__default.createElement("div", null, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
615
593
  return e === null || e === void 0 ? void 0 : e.isShow;
616
- })) === null || _routes$filter2 === void 0 ? void 0 : _routes$filter2.map(function (item, index) {
594
+ })) === null || _shopConfigStyle$navB4 === void 0 ? void 0 : _shopConfigStyle$navB4.map(function (item, index) {
617
595
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
618
596
  Link: Link,
619
597
  href: item === null || item === void 0 ? void 0 : item.route,
@@ -867,7 +845,7 @@ var Hero1 = function Hero1(props) {
867
845
  }, /*#__PURE__*/React__default.createElement("div", {
868
846
  className: "w-[80%] md:w-2/3 xl:w-1/2 md:h-2/3 flex flex-col gap-2 md:gap-8 justify-center items-center bg-background opacity-90 absolute top-5 md:top-10 px-6 py-4 rounded-tr-[40px] rounded-bl-[40px] md:rounded-tr-[80px] md:rounded-bl-[80px]"
869
847
  }, /*#__PURE__*/React__default.createElement("div", {
870
- className: "text-xl md:text-4xl lg:text-[40px] text-primary font-medium"
848
+ className: "text-xl text-center md:text-4xl lg:text-[40px] text-primary font-medium"
871
849
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.title), /*#__PURE__*/React__default.createElement("div", {
872
850
  className: "text-center md:text-2xl lg:text-3xl font-medium"
873
851
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$3 = sectionData[0]) === null || _sectionData$3 === void 0 ? void 0 : _sectionData$3.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
@@ -1061,7 +1039,7 @@ var CarouselItem = function CarouselItem(props) {
1061
1039
  }, /*#__PURE__*/React__default.createElement("div", {
1062
1040
  className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
1063
1041
  }, /*#__PURE__*/React__default.createElement("div", {
1064
- className: "flex overflow-x-auto gap-2 hide-scrollbar items-center",
1042
+ className: "flex overflow-x-auto gap-2 no-scrollbar items-center",
1065
1043
  ref: listRef
1066
1044
  }, isAll ? /*#__PURE__*/React__default.createElement("div", {
1067
1045
  className: " " + ((Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0 ? "bg-primary text-textButton" : "bg-background") + " w-max border border-primary p-1 md:p-2 rounded-lg cursor-pointer whitespace-nowrap",
@@ -9572,7 +9550,7 @@ var TreatmentItem1 = function TreatmentItem1(props) {
9572
9550
  }))));
9573
9551
  };
9574
9552
 
9575
- var ProductsList7 = function ProductsList7(props) {
9553
+ var ProductList7 = function ProductList7(props) {
9576
9554
  var _props$shopConfigStyl = props.shopConfigStyle,
9577
9555
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9578
9556
  _props$data = props.data,
@@ -9657,7 +9635,7 @@ var Carousel = function Carousel(props) {
9657
9635
  className: "relative " + className + " ",
9658
9636
  style: style
9659
9637
  }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9660
- className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto hide-scrollbar",
9638
+ className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto no-scrollbar",
9661
9639
  ref: carouselRef
9662
9640
  }, data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (item, index) {
9663
9641
  return renderItem(item, index);
@@ -12515,7 +12493,25 @@ var SearchProduct1 = function SearchProduct1(props) {
12515
12493
  setListProducts = _useState[1];
12516
12494
  var _ProductController = ProductController(_extends({}, props)),
12517
12495
  getProductListSearch = _ProductController.getProductListSearch;
12496
+ var _useState2 = useState(""),
12497
+ valueSearch = _useState2[0],
12498
+ setSearchValue = _useState2[1];
12499
+ useEffect(function () {
12500
+ if (valueSearch === "") {
12501
+ setProducts([]);
12502
+ } else {
12503
+ var delayDebounceFn = setTimeout(function () {
12504
+ handleSearch(valueSearch);
12505
+ }, 500);
12506
+ return function () {
12507
+ return clearTimeout(delayDebounceFn);
12508
+ };
12509
+ }
12510
+ }, [valueSearch]);
12518
12511
  var handleSearch = function handleSearch(productName) {
12512
+ if (productName === void 0) {
12513
+ productName = "";
12514
+ }
12519
12515
  try {
12520
12516
  var _temp = function () {
12521
12517
  if (productName) {
@@ -12542,7 +12538,7 @@ var SearchProduct1 = function SearchProduct1(props) {
12542
12538
  },
12543
12539
  inputClassName: "w-full h-full p-2 text-lg",
12544
12540
  placeholder: (data === null || data === void 0 ? void 0 : data.sectionTitle) || "Tìm kiếm sản phẩm",
12545
- onChange: handleSearch,
12541
+ onChange: setSearchValue,
12546
12542
  icons: /*#__PURE__*/React__default.createElement("div", {
12547
12543
  className: "px-2"
12548
12544
  }, /*#__PURE__*/React__default.createElement(FiSearch, {
@@ -12580,15 +12576,32 @@ var SearchBar2 = function SearchBar2(props) {
12580
12576
  var _useState = useState([]),
12581
12577
  products = _useState[0],
12582
12578
  setProducts = _useState[1];
12579
+ var _useState2 = useState(""),
12580
+ valueSearch = _useState2[0],
12581
+ setSearchValue = _useState2[1];
12583
12582
  var _ProductController = ProductController(_extends({}, props)),
12584
12583
  getProductListSearch = _ProductController.getProductListSearch;
12584
+ useEffect(function () {
12585
+ if (valueSearch === "") {
12586
+ setProducts([]);
12587
+ } else {
12588
+ var delayDebounceFn = setTimeout(function () {
12589
+ handleSearch(valueSearch);
12590
+ }, 500);
12591
+ return function () {
12592
+ return clearTimeout(delayDebounceFn);
12593
+ };
12594
+ }
12595
+ }, [valueSearch]);
12585
12596
  var handleSearch = function handleSearch(productName) {
12586
12597
  if (productName === void 0) {
12587
12598
  productName = "";
12588
12599
  }
12589
12600
  try {
12590
12601
  var _temp = function () {
12591
- if (productName === "") setProducts([]);else {
12602
+ if (productName === "") {
12603
+ setProducts([]);
12604
+ } else {
12592
12605
  return Promise.resolve(getProductListSearch({
12593
12606
  productName: productName
12594
12607
  })).then(function (productList) {
@@ -12610,7 +12623,7 @@ var SearchBar2 = function SearchBar2(props) {
12610
12623
  className: "w-full",
12611
12624
  inputClassName: "w-full",
12612
12625
  placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
12613
- onChange: handleSearch
12626
+ onChange: setSearchValue
12614
12627
  }), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
12615
12628
  className: "max-h-64 overflow-y-auto flex flex-col gap-2"
12616
12629
  }, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
@@ -12881,5 +12894,5 @@ var VideoFull1 = function VideoFull1(props) {
12881
12894
  })) : null);
12882
12895
  };
12883
12896
 
12884
- export { About1, About5, Address1, Banner1, Banner2, Banner3, Banner7, BannerFull1, BannerFull2, Booking1, BookingForm6, Breadcrumb1, Button, Carts1, Contact1, CustomerRating1, CustomerRating10, CustomerRating5, CustomerRating6, DateTimePicker, Employees1, Features2, Features3, Footer1, Footer7, Gallery1, Hero1, Hero10, Hero11 as Hero12, Hero13, Hero2, Hero5, Hero6, Input, InputPhoneNumber, Links1, ModalNotification, NavBar1, NavBar7, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductHighlight1, ProductHot1, ProductHot3, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductItem7, ProductList5, ProductSale2, ProductSearch1, Products10, Products2, Products3, ProductsList7, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, ShopHighlights7, TextArea, TreatmentDetail1, TreatmentItem1, TreatmentsCategory7, TreatmentsList6, TreatmentsList7, VideoFull1 };
12897
+ export { About1, About5, Address1, Banner1, Banner2, Banner3, Banner7, BannerFull1, BannerFull2, Booking1, BookingForm6, Breadcrumb1, Button, Carts1, Contact1, CustomerRating1, CustomerRating10, CustomerRating5, CustomerRating6, DateTimePicker, Employees1, Features2, Features3, Footer1, Footer7, Gallery1, Hero1, Hero10, Hero11 as Hero12, Hero13, Hero2, Hero5, Hero6, Input, InputPhoneNumber, Links1, ModalNotification, NavBar1, NavBar7, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductHighlight1, ProductHot1, ProductHot3, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductItem7, ProductList5, ProductList7, ProductSale2, ProductSearch1, Products10, Products2, Products3, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, ShopHighlights7, TextArea, TreatmentDetail1, TreatmentItem1, TreatmentsCategory7, TreatmentsList6, TreatmentsList7, VideoFull1 };
12885
12898
  //# sourceMappingURL=index.modern.js.map