s-platform-landing-section 0.1.16 → 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.
@@ -303,7 +303,7 @@ var NavBar7 = function NavBar7(props) {
303
303
  href: item === null || item === void 0 ? void 0 : item.route,
304
304
  key: index
305
305
  }, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
306
- className: "py-1 border-b text-textHeading border-textHeading"
306
+ className: "whitespace-nowrap py-1 border-b text-textHeading border-textHeading"
307
307
  }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
308
308
  className: "py-1 text-textBody"
309
309
  }, item === null || item === void 0 ? void 0 : item.label));
@@ -505,7 +505,7 @@ var NavBar1 = function NavBar1(props) {
505
505
  href: item === null || item === void 0 ? void 0 : item.route,
506
506
  key: index
507
507
  }, /*#__PURE__*/React__default.createElement("div", {
508
- 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") + " "
509
509
  }, item === null || item === void 0 ? void 0 : item.label));
510
510
  })), cart(), userInfo ?
511
511
  /*#__PURE__*/
@@ -845,7 +845,7 @@ var Hero1 = function Hero1(props) {
845
845
  }, /*#__PURE__*/React__default.createElement("div", {
846
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]"
847
847
  }, /*#__PURE__*/React__default.createElement("div", {
848
- 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"
849
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", {
850
850
  className: "text-center md:text-2xl lg:text-3xl font-medium"
851
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, {
@@ -1039,7 +1039,7 @@ var CarouselItem = function CarouselItem(props) {
1039
1039
  }, /*#__PURE__*/React__default.createElement("div", {
1040
1040
  className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
1041
1041
  }, /*#__PURE__*/React__default.createElement("div", {
1042
- className: "flex overflow-x-auto gap-2 hide-scrollbar items-center",
1042
+ className: "flex overflow-x-auto gap-2 no-scrollbar items-center",
1043
1043
  ref: listRef
1044
1044
  }, isAll ? /*#__PURE__*/React__default.createElement("div", {
1045
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",
@@ -9635,7 +9635,7 @@ var Carousel = function Carousel(props) {
9635
9635
  className: "relative " + className + " ",
9636
9636
  style: style
9637
9637
  }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9638
- 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",
9639
9639
  ref: carouselRef
9640
9640
  }, data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (item, index) {
9641
9641
  return renderItem(item, index);
@@ -12493,7 +12493,25 @@ var SearchProduct1 = function SearchProduct1(props) {
12493
12493
  setListProducts = _useState[1];
12494
12494
  var _ProductController = ProductController(_extends({}, props)),
12495
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]);
12496
12511
  var handleSearch = function handleSearch(productName) {
12512
+ if (productName === void 0) {
12513
+ productName = "";
12514
+ }
12497
12515
  try {
12498
12516
  var _temp = function () {
12499
12517
  if (productName) {
@@ -12520,7 +12538,7 @@ var SearchProduct1 = function SearchProduct1(props) {
12520
12538
  },
12521
12539
  inputClassName: "w-full h-full p-2 text-lg",
12522
12540
  placeholder: (data === null || data === void 0 ? void 0 : data.sectionTitle) || "Tìm kiếm sản phẩm",
12523
- onChange: handleSearch,
12541
+ onChange: setSearchValue,
12524
12542
  icons: /*#__PURE__*/React__default.createElement("div", {
12525
12543
  className: "px-2"
12526
12544
  }, /*#__PURE__*/React__default.createElement(FiSearch, {
@@ -12558,15 +12576,32 @@ var SearchBar2 = function SearchBar2(props) {
12558
12576
  var _useState = useState([]),
12559
12577
  products = _useState[0],
12560
12578
  setProducts = _useState[1];
12579
+ var _useState2 = useState(""),
12580
+ valueSearch = _useState2[0],
12581
+ setSearchValue = _useState2[1];
12561
12582
  var _ProductController = ProductController(_extends({}, props)),
12562
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]);
12563
12596
  var handleSearch = function handleSearch(productName) {
12564
12597
  if (productName === void 0) {
12565
12598
  productName = "";
12566
12599
  }
12567
12600
  try {
12568
12601
  var _temp = function () {
12569
- if (productName === "") setProducts([]);else {
12602
+ if (productName === "") {
12603
+ setProducts([]);
12604
+ } else {
12570
12605
  return Promise.resolve(getProductListSearch({
12571
12606
  productName: productName
12572
12607
  })).then(function (productList) {
@@ -12588,7 +12623,7 @@ var SearchBar2 = function SearchBar2(props) {
12588
12623
  className: "w-full",
12589
12624
  inputClassName: "w-full",
12590
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",
12591
- onChange: handleSearch
12626
+ onChange: setSearchValue
12592
12627
  }), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
12593
12628
  className: "max-h-64 overflow-y-auto flex flex-col gap-2"
12594
12629
  }, products === null || products === void 0 ? void 0 : products.map(function (item, index) {