s-platform-landing-section 0.1.22 → 0.1.23

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.
@@ -147,7 +147,6 @@ var LinkToPage = function LinkToPage(props) {
147
147
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
148
148
  return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
149
149
  };
150
- var SSHOP_SPA_TOKEN = "sshop-spa-token";
151
150
  var genLinkSearch = function genLinkSearch(keyword) {
152
151
  return "/tim-kiem?tu-khoa=" + keyword;
153
152
  };
@@ -882,6 +881,8 @@ var Input = forwardRef(function (props, ref) {
882
881
  style = _props$style === void 0 ? {} : _props$style,
883
882
  _props$onChange = props.onChange,
884
883
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
884
+ _props$onKeyDown = props.onKeyDown,
885
+ onKeyDown = _props$onKeyDown === void 0 ? function () {} : _props$onKeyDown,
885
886
  _props$disabled = props.disabled,
886
887
  disabled = _props$disabled === void 0 ? false : _props$disabled,
887
888
  _props$defaultValue = props.defaultValue,
@@ -960,6 +961,9 @@ var Input = forwardRef(function (props, ref) {
960
961
  _setValue(value);
961
962
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
962
963
  };
964
+ var handleOnKeyDown = function handleOnKeyDown(e) {
965
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
966
+ };
963
967
  var changeQuantity = function changeQuantity(quantity) {
964
968
  var newValue = parseInt(value) + quantity;
965
969
  if (!disabled && newValue > min && (max === null || newValue <= max)) {
@@ -1000,7 +1004,10 @@ var Input = forwardRef(function (props, ref) {
1000
1004
  onChange: handleOnChange,
1001
1005
  required: required,
1002
1006
  className: _inputClassName,
1003
- ref: refInput
1007
+ ref: refInput,
1008
+ onKeyDown: function onKeyDown(e) {
1009
+ handleOnKeyDown(e);
1010
+ }
1004
1011
  }), suffix ? /*#__PURE__*/React__default.createElement("div", null, suffix) : null, isHidden ? /*#__PURE__*/React__default.createElement("button", {
1005
1012
  onClick: function onClick() {
1006
1013
  changeHidden();
@@ -1020,12 +1027,19 @@ var Hero1 = function Hero1(props) {
1020
1027
  var _sectionData$, _sectionData$$srcImag, _sectionData$2, _sectionData$3, _sectionData$4, _sectionData$4$button, _sectionData$4$button2, _sectionData$5, _sectionData$5$button, _sectionData$5$button2, _sectionData$6, _sectionData$6$button, _sectionData$6$button2;
1021
1028
  var shopConfigStyle = props.shopConfigStyle,
1022
1029
  data = props.data,
1030
+ _props$router = props.router,
1031
+ router = _props$router === void 0 ? function () {} : _props$router,
1023
1032
  _props$Link = props.Link,
1024
1033
  Link = _props$Link === void 0 ? null : _props$Link;
1025
1034
  var _useState = useState(""),
1026
1035
  value = _useState[0],
1027
1036
  setValue = _useState[1];
1028
1037
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
1038
+ var handleSearch = function handleSearch(e) {
1039
+ if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
1040
+ router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
1041
+ }
1042
+ };
1029
1043
  return /*#__PURE__*/React__default.createElement("div", {
1030
1044
  style: {
1031
1045
  backgroundImage: "url(" + (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$srcImag = _sectionData$.srcImages) === null || _sectionData$$srcImag === void 0 ? void 0 : _sectionData$$srcImag[0]) + ")"
@@ -1053,6 +1067,9 @@ var Hero1 = function Hero1(props) {
1053
1067
  icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, null),
1054
1068
  wrapClassName: "w-full",
1055
1069
  inputClassName: "w-full",
1070
+ onKeyDown: function onKeyDown(e) {
1071
+ handleSearch(e);
1072
+ },
1056
1073
  onChange: setValue
1057
1074
  }), value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
1058
1075
  Link: Link,
@@ -1079,7 +1096,7 @@ var Hero2 = function Hero2(props) {
1079
1096
  alt: data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title,
1080
1097
  className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
1081
1098
  }), /*#__PURE__*/React__default.createElement("div", {
1082
- className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-1/3 top-2 sm:top-[20%] xl:top-1/4 right-[2%] lg:right-[15%]"
1099
+ className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-[40%] top-2 sm:top-[20%] xl:top-1/4 right-[2%] lg:right-[15%]"
1083
1100
  }, /*#__PURE__*/React__default.createElement("img", {
1084
1101
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
1085
1102
  alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName,
@@ -8030,10 +8047,12 @@ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
8030
8047
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
8031
8048
  className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
8032
8049
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8033
- return /*#__PURE__*/React__default.createElement(ProductItem1, {
8050
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
8034
8051
  key: index,
8052
+ href: getLinkServiceDetail(product === null || product === void 0 ? void 0 : product.productInfo)
8053
+ }, /*#__PURE__*/React__default.createElement(ProductItem1, {
8035
8054
  product: product === null || product === void 0 ? void 0 : product.productInfo
8036
- });
8055
+ }));
8037
8056
  })) : /*#__PURE__*/React__default.createElement("div", {
8038
8057
  className: "text-gray3 text-center p-12"
8039
8058
  }, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
@@ -8120,6 +8139,12 @@ var ModalNotification = function ModalNotification(props) {
8120
8139
  style = _props$style === void 0 ? {} : _props$style,
8121
8140
  _props$buttonClassNam = props.buttonClassName,
8122
8141
  buttonClassName = _props$buttonClassNam === void 0 ? "" : _props$buttonClassNam;
8142
+ useEffect(function () {
8143
+ document.body.style.overflow = "hidden";
8144
+ return function () {
8145
+ document.body.style.overflow = "auto";
8146
+ };
8147
+ }, []);
8123
8148
  var handleClickOutside = function handleClickOutside(event) {
8124
8149
  event.stopPropagation();
8125
8150
  if (onClose) {
@@ -8131,7 +8156,9 @@ var ModalNotification = function ModalNotification(props) {
8131
8156
  };
8132
8157
  return /*#__PURE__*/React__default.createElement("div", {
8133
8158
  className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 ",
8134
- onClick: handleClickOutside
8159
+ onClick: function onClick(e) {
8160
+ return handleClickOutside(e);
8161
+ }
8135
8162
  }, /*#__PURE__*/React__default.createElement("div", {
8136
8163
  className: "flex items-center justify-center relative " + className,
8137
8164
  onClick: function onClick(e) {
@@ -8141,7 +8168,9 @@ var ModalNotification = function ModalNotification(props) {
8141
8168
  ref: modalRef
8142
8169
  }, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
8143
8170
  className: "absolute top-4 right-4 " + buttonClassName,
8144
- onClick: onClose
8171
+ onClick: function onClick(e) {
8172
+ return handleClickOutside(e);
8173
+ }
8145
8174
  }, /*#__PURE__*/React__default.createElement(RxCross2, null))));
8146
8175
  };
8147
8176
 
@@ -8944,7 +8973,6 @@ var BookingForm = function BookingForm(props) {
8944
8973
  var _EmployeeController = EmployeeController(_extends({}, props)),
8945
8974
  _EmployeeController$l = _EmployeeController.listEmployment,
8946
8975
  listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
8947
- var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
8948
8976
  var _ProductController = ProductController(_extends({}, props, {
8949
8977
  params: productsParams
8950
8978
  })),
@@ -9115,6 +9143,7 @@ var BookingForm = function BookingForm(props) {
9115
9143
  inputClassName: "w-full focus:outline-none focus:ring-0"
9116
9144
  }), /*#__PURE__*/React__default.createElement(InputPhoneNumber, {
9117
9145
  ref: inputPhoneNumberRef,
9146
+ name: "customerPhone",
9118
9147
  label: "Số điện thoại",
9119
9148
  placeholder: "Nhập số điện thoại",
9120
9149
  rules: [{
@@ -9409,44 +9438,6 @@ var ProductDetailController = function ProductDetailController(props) {
9409
9438
  };
9410
9439
  };
9411
9440
 
9412
- var ServiceDetail1 = function ServiceDetail1(props) {
9413
- var shopConfigStyle = props.shopConfigStyle;
9414
- var _ProductDetailControl = ProductDetailController(props),
9415
- product = _ProductDetailControl.product;
9416
- console.log('product', product);
9417
- return /*#__PURE__*/React__default.createElement("div", {
9418
- className: SECTION_DEFAULT_CLASS + " !py-0"
9419
- }, /*#__PURE__*/React__default.createElement("div", {
9420
- className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
9421
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
9422
- product: product,
9423
- className: "w-full aspect-square rounded-2xl"
9424
- }), /*#__PURE__*/React__default.createElement("div", {
9425
- className: "col-span-2"
9426
- }, /*#__PURE__*/React__default.createElement("p", {
9427
- className: "font-semibold text-2xl"
9428
- }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9429
- product: product,
9430
- className: "mt-6"
9431
- }), /*#__PURE__*/React__default.createElement("div", {
9432
- className: "flex gap-4 mt-6"
9433
- }, /*#__PURE__*/React__default.createElement("div", null, "Th\u1EDDi l\u01B0\u1EE3ng: "), /*#__PURE__*/React__default.createElement("div", null, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes))), /*#__PURE__*/React__default.createElement("div", {
9434
- className: "flex gap-4 mt-6"
9435
- }, /*#__PURE__*/React__default.createElement(Button, {
9436
- label: "ĐẶT LỊCH",
9437
- shopConfigStyle: shopConfigStyle
9438
- })), /*#__PURE__*/React__default.createElement("p", {
9439
- className: "text-lg mt-12 pt-6 border-t border-stroke"
9440
- }, "M\xF4 t\u1EA3"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
9441
- className: "mt-6",
9442
- dangerouslySetInnerHTML: {
9443
- __html: product === null || product === void 0 ? void 0 : product.description
9444
- }
9445
- }) : /*#__PURE__*/React__default.createElement("div", {
9446
- className: "text-gray3 mt-2"
9447
- }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
9448
- };
9449
-
9450
9441
  var CartController = function CartController(props) {
9451
9442
  var addToCart = props.addToCart,
9452
9443
  dispatch = props.dispatch;
@@ -9472,7 +9463,7 @@ var CartController = function CartController(props) {
9472
9463
  };
9473
9464
  };
9474
9465
 
9475
- var TreatmentDetail1 = function TreatmentDetail1(props) {
9466
+ var ServiceDetail1 = function ServiceDetail1(props) {
9476
9467
  var _product$images;
9477
9468
  var shopConfigStyle = props.shopConfigStyle,
9478
9469
  shopConfig = props.shopConfig;
@@ -9529,34 +9520,168 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
9529
9520
  return /*#__PURE__*/React__default.createElement("div", {
9530
9521
  className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
9531
9522
  }, /*#__PURE__*/React__default.createElement("div", {
9532
- className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
9523
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
9533
9524
  }, /*#__PURE__*/React__default.createElement("div", {
9534
9525
  className: "flex flex-col gap-4 col-span-2"
9526
+ }, /*#__PURE__*/React__default.createElement("div", {
9527
+ className: "rounded-2xl p-2 border"
9535
9528
  }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
9536
9529
  src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
9537
- className: "w-full aspect-square object-cover rounded-2xl"
9530
+ className: "w-full aspect-square object-contain rounded-2xl"
9538
9531
  }) : /*#__PURE__*/React__default.createElement(ProductImage, {
9539
9532
  product: product,
9540
- className: "w-full aspect-square object-contain rounded-2xl"
9533
+ className: "w-full aspect-square !object-contain rounded-2xl"
9534
+ })), /*#__PURE__*/React__default.createElement("div", {
9535
+ className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
9536
+ }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
9537
+ return /*#__PURE__*/React__default.createElement("img", {
9538
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
9539
+ key: item === null || item === void 0 ? void 0 : item.imageId,
9540
+ alt: "",
9541
+ className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " h-16 w-16 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
9542
+ onClick: function onClick() {
9543
+ handleDisplayImage(item);
9544
+ }
9545
+ });
9546
+ }))), /*#__PURE__*/React__default.createElement("div", {
9547
+ className: "col-span-3 mt-4 lg:mt-0"
9548
+ }, /*#__PURE__*/React__default.createElement("p", {
9549
+ className: "font-semibold text-2xl"
9550
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9551
+ product: product,
9552
+ className: "mt-3 md:mt-6 text-[22px]"
9541
9553
  }), /*#__PURE__*/React__default.createElement("div", {
9554
+ className: " text-lg py-3"
9555
+ }, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
9556
+ label: "ĐẶT LỊCH NGAY",
9557
+ shopConfigStyle: shopConfigStyle,
9558
+ onClick: function onClick(e) {
9559
+ return handleOpenModalBooking(e);
9560
+ }
9561
+ }), /*#__PURE__*/React__default.createElement("p", {
9562
+ className: "text-lg mt-12 text-xl pb-1 pt-6 border-t border-stroke"
9563
+ }, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
9564
+ className: "h-max"
9565
+ }, /*#__PURE__*/React__default.createElement("div", {
9566
+ ref: descriptionRef,
9567
+ className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
9568
+ dangerouslySetInnerHTML: {
9569
+ __html: product === null || product === void 0 ? void 0 : product.description
9570
+ }
9571
+ }), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
9572
+ className: "h-10 relative -mt-10 rounded-b-lg",
9573
+ style: {
9574
+ background: "linear-gradient(to top, #81818169 0%, #00000003 50%)"
9575
+ }
9576
+ }) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
9577
+ className: "w-full flex justify-center mt-2"
9578
+ }, /*#__PURE__*/React__default.createElement(Button, {
9579
+ label: isSeeMore ? "Thu nhỏ" : "Xem thêm",
9580
+ className: " bottom-0 z-50",
9581
+ onClick: function onClick() {
9582
+ setIsSeeMore(!isSeeMore);
9583
+ }
9584
+ })) : null) : /*#__PURE__*/React__default.createElement("div", {
9585
+ className: "text-gray3 mt-2"
9586
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
9587
+ onClose: handleCloseModal
9588
+ }, /*#__PURE__*/React__default.createElement(BookingForm, {
9589
+ isModalBooking: isBooking,
9590
+ className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
9591
+ onCloseFormBooking: handleCloseModal,
9592
+ defaultValue: dataBooking,
9593
+ shopConfig: shopConfig,
9594
+ shopConfigStyle: shopConfigStyle
9595
+ })) : null);
9596
+ };
9597
+
9598
+ var TreatmentDetail1 = function TreatmentDetail1(props) {
9599
+ var _product$images;
9600
+ var shopConfigStyle = props.shopConfigStyle,
9601
+ shopConfig = props.shopConfig;
9602
+ var _ProductDetailControl = ProductDetailController(props),
9603
+ product = _ProductDetailControl.product;
9604
+ var _useState = useState(),
9605
+ displayImage = _useState[0],
9606
+ setDisplayImage = _useState[1];
9607
+ var _useState2 = useState(false),
9608
+ isSeeMore = _useState2[0],
9609
+ setIsSeeMore = _useState2[1];
9610
+ var _useState3 = useState(true),
9611
+ hiddenButton = _useState3[0],
9612
+ setHiddenButton = _useState3[1];
9613
+ var descriptionRef = useRef();
9614
+ var _useState4 = useState(false),
9615
+ isBooking = _useState4[0],
9616
+ setIsBooking = _useState4[1];
9617
+ var _useState5 = useState([]),
9618
+ dataBooking = _useState5[0],
9619
+ setDataBooking = _useState5[1];
9620
+ useEffect(function () {
9621
+ if (product) {
9622
+ if (descriptionRef.current) {
9623
+ var descriptionHeight = descriptionRef.current.offsetHeight;
9624
+ if (descriptionHeight >= 700) {
9625
+ setHiddenButton(false);
9626
+ }
9627
+ }
9628
+ }
9629
+ }, [product]);
9630
+ var handleDisplayImage = function handleDisplayImage(item) {
9631
+ setDisplayImage(item);
9632
+ };
9633
+ var handleOpenModalBooking = function handleOpenModalBooking(event) {
9634
+ try {
9635
+ event.stopPropagation();
9636
+ setDataBooking([_extends({}, product, {
9637
+ quantity: 1,
9638
+ technical: {},
9639
+ oldService: false,
9640
+ label: product === null || product === void 0 ? void 0 : product.productName,
9641
+ value: product === null || product === void 0 ? void 0 : product.productId
9642
+ })]);
9643
+ setIsBooking(true);
9644
+ } catch (error) {
9645
+ console.log("::::::::::errrorrrrr::::::", error);
9646
+ }
9647
+ };
9648
+ var handleCloseModal = function handleCloseModal() {
9649
+ setIsBooking(false);
9650
+ setDataBooking([]);
9651
+ };
9652
+ return /*#__PURE__*/React__default.createElement("div", {
9653
+ className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
9654
+ }, /*#__PURE__*/React__default.createElement("div", {
9655
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
9656
+ }, /*#__PURE__*/React__default.createElement("div", {
9657
+ className: "flex flex-col gap-4 col-span-2"
9658
+ }, /*#__PURE__*/React__default.createElement("div", {
9659
+ className: "rounded-2xl p-2 border"
9660
+ }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
9661
+ src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
9662
+ className: "w-full aspect-square object-contain rounded-2xl"
9663
+ }) : /*#__PURE__*/React__default.createElement(ProductImage, {
9664
+ product: product,
9665
+ className: "w-full aspect-square !object-contain rounded-2xl"
9666
+ })), /*#__PURE__*/React__default.createElement("div", {
9542
9667
  className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
9543
9668
  }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
9544
9669
  return /*#__PURE__*/React__default.createElement("img", {
9545
9670
  src: item === null || item === void 0 ? void 0 : item.imageUrl,
9546
9671
  key: item === null || item === void 0 ? void 0 : item.imageId,
9547
9672
  alt: "",
9548
- className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " h-16 w-16 rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
9673
+ className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " h-16 w-16 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
9549
9674
  onClick: function onClick() {
9550
9675
  handleDisplayImage(item);
9551
9676
  }
9552
9677
  });
9553
9678
  }))), /*#__PURE__*/React__default.createElement("div", {
9554
- className: "col-span-3"
9679
+ className: "col-span-3 mt-4 lg:mt-0"
9555
9680
  }, /*#__PURE__*/React__default.createElement("p", {
9556
9681
  className: "font-semibold text-2xl"
9557
9682
  }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9558
9683
  product: product,
9559
- className: "mt-6 text-[22px]"
9684
+ className: "mt-3 md:mt-6 text-[22px]"
9560
9685
  }), /*#__PURE__*/React__default.createElement("div", {
9561
9686
  className: " text-lg py-3"
9562
9687
  }, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
@@ -9593,6 +9718,7 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
9593
9718
  }, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
9594
9719
  onClose: handleCloseModal
9595
9720
  }, /*#__PURE__*/React__default.createElement(BookingForm, {
9721
+ isModalBooking: isBooking,
9596
9722
  className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
9597
9723
  onCloseFormBooking: handleCloseModal,
9598
9724
  defaultValue: dataBooking,
@@ -10235,23 +10361,17 @@ var Products10 = function Products10(props) {
10235
10361
  };
10236
10362
 
10237
10363
  var listFilter = [{
10364
+ label: "Tất cả",
10365
+ value: "all"
10366
+ }, {
10238
10367
  label: "Khuyến mãi",
10239
- value: "discount",
10240
- filter: {
10241
- isDiscount: true
10242
- }
10368
+ value: "discount"
10243
10369
  }, {
10244
10370
  label: "Nổi bật",
10245
- value: "isHighlight",
10246
- filter: {
10247
- isHighlight: true
10248
- }
10371
+ value: "isHighlight"
10249
10372
  }, {
10250
10373
  label: "Giá thấp đến cao",
10251
- value: "sortPriceDESC",
10252
- filter: {
10253
- isHighlight: true
10254
- }
10374
+ value: "sortPriceDESC"
10255
10375
  }];
10256
10376
  var Products11 = function Products11(props) {
10257
10377
  var _productsFilter$slice;
@@ -10279,6 +10399,9 @@ var Products11 = function Products11(props) {
10279
10399
  var _useState4 = useState([]),
10280
10400
  productsFilter = _useState4[0],
10281
10401
  setProductsFilter = _useState4[1];
10402
+ var _useState5 = useState(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]),
10403
+ filterItem = _useState5[0],
10404
+ setFilterItem = _useState5[1];
10282
10405
  var _CategoryController = CategoryController(_extends({}, props, {
10283
10406
  params: params
10284
10407
  })),
@@ -10302,6 +10425,7 @@ var Products11 = function Products11(props) {
10302
10425
  var handleChooseCategory = function handleChooseCategory(category) {
10303
10426
  setCategorySelected(category);
10304
10427
  setFirstLoading(true);
10428
+ setFilterItem(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]);
10305
10429
  setParams(function (prev) {
10306
10430
  return _extends({}, prev, {
10307
10431
  categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
@@ -10323,6 +10447,7 @@ var Products11 = function Products11(props) {
10323
10447
  }
10324
10448
  }, [products]);
10325
10449
  var handleFilter = function handleFilter(item) {
10450
+ setFilterItem(item);
10326
10451
  if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
10327
10452
  var productsCopy = [].concat(products);
10328
10453
  productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
@@ -10348,26 +10473,32 @@ var Products11 = function Products11(props) {
10348
10473
  }
10349
10474
  };
10350
10475
  return /*#__PURE__*/React__default.createElement("div", {
10351
- className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
10476
+ className: SECTION_CLASS + " grid grid-cols-1 !mt-0 md:grid-cols-4 gap-6"
10352
10477
  }, /*#__PURE__*/React__default.createElement("div", {
10353
- className: "md:sticky top-20 self-start"
10478
+ className: "md:sticky top-0 self-start"
10354
10479
  }, /*#__PURE__*/React__default.createElement("div", {
10355
10480
  className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
10356
10481
  }, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
10357
10482
  return /*#__PURE__*/React__default.createElement("div", {
10358
10483
  className: "px-6 py-2 hover:bg-gray-100 hover:text-primary cursor-pointer rounded-lg " + ((categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.categoryId) === (item === null || item === void 0 ? void 0 : item.categoryId) ? " bg-primary text-textButton" : ""),
10484
+ key: "sdjfdh-" + index,
10359
10485
  onClick: function onClick() {
10360
10486
  handleChooseCategory(item);
10361
- },
10362
- key: "sdjfdh-" + index
10487
+ }
10363
10488
  }, item === null || item === void 0 ? void 0 : item.cateName);
10364
10489
  }))), /*#__PURE__*/React__default.createElement("div", {
10365
- className: "md:col-span-3 flex flex-col gap-8"
10366
- }, /*#__PURE__*/React__default.createElement(CarouselItem, {
10367
- data: listFilter,
10368
- isNavigateButton: false,
10369
- onClick: handleFilter
10370
- }), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
10490
+ className: "md:col-span-3 flex flex-col gap-6"
10491
+ }, /*#__PURE__*/React__default.createElement("div", {
10492
+ className: "flex gap-4"
10493
+ }, listFilter === null || listFilter === void 0 ? void 0 : listFilter.map(function (item, index) {
10494
+ return /*#__PURE__*/React__default.createElement("div", {
10495
+ key: "kgkf-" + index,
10496
+ className: ((filterItem === null || filterItem === void 0 ? void 0 : filterItem.value) === (item === null || item === void 0 ? void 0 : item.value) ? "bg-primary text-textButton" : "bg-background") + " \n w-max border border-primary py-1 px-2 md:py-2 md:px-3 rounded-lg cursor-pointer whitespace-nowrap",
10497
+ onClick: function onClick() {
10498
+ handleFilter(item);
10499
+ }
10500
+ }, item === null || item === void 0 ? void 0 : item.label);
10501
+ })), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
10371
10502
  className: "w-full h-96 mb-1 flex justify-center items-center"
10372
10503
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
10373
10504
  className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
@@ -10868,8 +10999,8 @@ var ProductDetail10 = function ProductDetail10(props) {
10868
10999
  var _product$images2;
10869
11000
  var shopConfigStyle = props.shopConfigStyle,
10870
11001
  shopConfig = props.shopConfig,
10871
- _props$handleRedirect = props.handleRedirect,
10872
- handleRedirect = _props$handleRedirect === void 0 ? function () {} : _props$handleRedirect;
11002
+ _props$router = props.router,
11003
+ router = _props$router === void 0 ? function () {} : _props$router;
10873
11004
  var _ProductDetailControl = ProductDetailController(props),
10874
11005
  product = _ProductDetailControl.product;
10875
11006
  var _useState = useState(),
@@ -10967,7 +11098,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10967
11098
  var _refInputQuantity$cur3;
10968
11099
  var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
10969
11100
  return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
10970
- handleRedirect("/gio-hang");
11101
+ router === null || router === void 0 ? void 0 : router.push("/gio-hang");
10971
11102
  });
10972
11103
  }
10973
11104
  }();
@@ -11097,8 +11228,8 @@ var ProductDetail11 = function ProductDetail11(props) {
11097
11228
  var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
11098
11229
  var shopConfigStyle = props.shopConfigStyle,
11099
11230
  shopConfig = props.shopConfig,
11100
- _props$handleRedirect = props.handleRedirect,
11101
- handleRedirect = _props$handleRedirect === void 0 ? function () {} : _props$handleRedirect;
11231
+ _props$router = props.router,
11232
+ router = _props$router === void 0 ? function () {} : _props$router;
11102
11233
  var _ProductDetailControl = ProductDetailController(props),
11103
11234
  product = _ProductDetailControl.product;
11104
11235
  var _useState = useState(),
@@ -11196,7 +11327,7 @@ var ProductDetail11 = function ProductDetail11(props) {
11196
11327
  var _refInputQuantity$cur3;
11197
11328
  var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
11198
11329
  return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
11199
- handleRedirect("/gio-hang");
11330
+ router === null || router === void 0 ? void 0 : router.push("/gio-hang");
11200
11331
  });
11201
11332
  }
11202
11333
  }();
@@ -13357,7 +13488,7 @@ var SearchProduct1 = function SearchProduct1(props) {
13357
13488
  }
13358
13489
  }))
13359
13490
  }), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
13360
- className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
13491
+ className: "max-h-64 overflow-y-auto flex flex-col scroll-container gap-2 pr-3"
13361
13492
  }, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
13362
13493
  var _item$productInfo, _item$productInfo2;
13363
13494
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
@@ -13445,7 +13576,7 @@ var SearchBar2 = function SearchBar2(props) {
13445
13576
  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",
13446
13577
  onChange: setSearchValue
13447
13578
  }), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
13448
- className: "max-h-64 overflow-y-auto flex flex-col gap-2"
13579
+ className: "max-h-64 overflow-y-auto scroll-container flex flex-col gap-2"
13449
13580
  }, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
13450
13581
  var _item$productInfo;
13451
13582
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
@@ -13472,10 +13603,17 @@ var SearchBar5 = function SearchBar5(props) {
13472
13603
  var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
13473
13604
  var _props$Link = props.Link,
13474
13605
  Link = _props$Link === void 0 ? null : _props$Link,
13606
+ _props$router = props.router,
13607
+ router = _props$router === void 0 ? function () {} : _props$router,
13475
13608
  data = props.data;
13476
13609
  var _useState = useState(""),
13477
13610
  value = _useState[0],
13478
13611
  setValue = _useState[1];
13612
+ var handleSearch = function handleSearch(e) {
13613
+ if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
13614
+ router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
13615
+ }
13616
+ };
13479
13617
  return /*#__PURE__*/React__default.createElement("div", {
13480
13618
  className: SECTION_CLASS + " md:mt-6"
13481
13619
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -13496,6 +13634,9 @@ var SearchBar5 = function SearchBar5(props) {
13496
13634
  }),
13497
13635
  wrapClassName: "w-full sm:w-[60%] md:w-[50%] lg:w-[40%]",
13498
13636
  className: "w-full bg-bgSecondary mb-2 md:h-12",
13637
+ onKeyDown: function onKeyDown(e) {
13638
+ handleSearch(e);
13639
+ },
13499
13640
  style: {
13500
13641
  borderRadius: "32px"
13501
13642
  },
@@ -13518,10 +13659,17 @@ var SearchBar6 = function SearchBar6(props) {
13518
13659
  var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
13519
13660
  var _props$Link = props.Link,
13520
13661
  Link = _props$Link === void 0 ? null : _props$Link,
13662
+ _props$router = props.router,
13663
+ router = _props$router === void 0 ? function () {} : _props$router,
13521
13664
  data = props.data;
13522
13665
  var _useState = useState(""),
13523
13666
  value = _useState[0],
13524
13667
  setValue = _useState[1];
13668
+ var handleSearch = function handleSearch(e) {
13669
+ if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
13670
+ router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
13671
+ }
13672
+ };
13525
13673
  return /*#__PURE__*/React__default.createElement("div", {
13526
13674
  className: "w-full flex flex-col justify-center px-3 md:px-6 gap-2 lg:gap-3 items-center h-32 lg:h-44 ",
13527
13675
  style: {
@@ -13543,7 +13691,10 @@ var SearchBar6 = function SearchBar6(props) {
13543
13691
  wrapClassName: " w-full h-full",
13544
13692
  inputClassName: "w-full",
13545
13693
  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",
13546
- onChange: setValue
13694
+ onChange: setValue,
13695
+ onKeyDown: function onKeyDown(e) {
13696
+ handleSearch(e);
13697
+ }
13547
13698
  }), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
13548
13699
  Link: Link,
13549
13700
  href: genLinkSearch(value)