s-platform-landing-section 0.1.10-alpha.7 → 0.1.10-alpha.9

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/dist/index.js CHANGED
@@ -7802,7 +7802,10 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
7802
7802
  var _useState = React.useState(defaultValue),
7803
7803
  value = _useState[0],
7804
7804
  _setValue = _useState[1];
7805
- var _useState2 = React.useState({}),
7805
+ var _useState2 = React.useState({
7806
+ label: "+84",
7807
+ value: "+84"
7808
+ }),
7806
7809
  countryCode = _useState2[0],
7807
7810
  setCountryCode = _useState2[1];
7808
7811
  var _useState3 = React.useState(""),
@@ -7822,7 +7825,8 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
7822
7825
  return _setValue(text);
7823
7826
  },
7824
7827
  getValue: function getValue() {
7825
- return value;
7828
+ var phoneNumber = (countryCode === null || countryCode === void 0 ? void 0 : countryCode.value) + (value === null || value === void 0 ? void 0 : value.slice(1));
7829
+ return phoneNumber;
7826
7830
  },
7827
7831
  setError: function setError(err) {
7828
7832
  return _setError(err);
@@ -10612,9 +10616,42 @@ var Carts1 = function Carts1(props) {
10612
10616
  var _state$cart;
10613
10617
  return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
10614
10618
  });
10619
+ var shadowRef = React.useRef(null);
10620
+ var _useState7 = React.useState(false),
10621
+ isShadow = _useState7[0],
10622
+ setIsShadow = _useState7[1];
10615
10623
  var _OrderControllerWitho = OrderControllerWithoutLogin(props),
10616
10624
  _OrderControllerWitho2 = _OrderControllerWitho.draftOrderWithoutLogin,
10617
10625
  draftOrderWithoutLogin = _OrderControllerWitho2 === void 0 ? function () {} : _OrderControllerWitho2;
10626
+ React.useEffect(function () {
10627
+ var handleScroll = function handleScroll() {
10628
+ if (shadowRef !== null && shadowRef !== void 0 && shadowRef.current) {
10629
+ var _shadowRef$current;
10630
+ var footerPosition = shadowRef === null || shadowRef === void 0 ? void 0 : (_shadowRef$current = shadowRef.current) === null || _shadowRef$current === void 0 ? void 0 : _shadowRef$current.getBoundingClientRect();
10631
+ if ((footerPosition === null || footerPosition === void 0 ? void 0 : footerPosition.bottom) >= window.innerHeight) {
10632
+ setIsShadow(true);
10633
+ } else {
10634
+ setIsShadow(false);
10635
+ }
10636
+ }
10637
+ };
10638
+ handleScroll();
10639
+ window.addEventListener("resize", handleScroll);
10640
+ window.addEventListener("scroll", handleScroll);
10641
+ return function () {
10642
+ window.removeEventListener("scroll", handleScroll);
10643
+ window.removeEventListener("resize", handleScroll);
10644
+ };
10645
+ }, []);
10646
+ React.useEffect(function () {
10647
+ var selectedProducts = cartItems === null || cartItems === void 0 ? void 0 : cartItems.filter(function (item) {
10648
+ return chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.some(function (product) {
10649
+ var _product$variant, _item$variant;
10650
+ return (product === null || product === void 0 ? void 0 : (_product$variant = product.variant) === null || _product$variant === void 0 ? void 0 : _product$variant.variantId) === (item === null || item === void 0 ? void 0 : (_item$variant = item.variant) === null || _item$variant === void 0 ? void 0 : _item$variant.variantId);
10651
+ });
10652
+ });
10653
+ setChosenProducts(selectedProducts);
10654
+ }, [cartItems]);
10618
10655
  var handleCheckAll = function handleCheckAll(event) {
10619
10656
  var checked = event.target.checked;
10620
10657
  if (checked) {
@@ -10625,15 +10662,6 @@ var Carts1 = function Carts1(props) {
10625
10662
  setCheckAll(checked);
10626
10663
  }
10627
10664
  };
10628
- React.useEffect(function () {
10629
- var selectedProducts = cartItems === null || cartItems === void 0 ? void 0 : cartItems.filter(function (item) {
10630
- return chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.some(function (product) {
10631
- var _product$variant, _item$variant;
10632
- return (product === null || product === void 0 ? void 0 : (_product$variant = product.variant) === null || _product$variant === void 0 ? void 0 : _product$variant.variantId) === (item === null || item === void 0 ? void 0 : (_item$variant = item.variant) === null || _item$variant === void 0 ? void 0 : _item$variant.variantId);
10633
- });
10634
- });
10635
- setChosenProducts(selectedProducts);
10636
- }, [cartItems]);
10637
10665
  var handleTotalPrice = function handleTotalPrice() {
10638
10666
  var totalPrice = chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.reduce(function (sum, element) {
10639
10667
  var _element$variant;
@@ -10696,6 +10724,11 @@ var Carts1 = function Carts1(props) {
10696
10724
  var _res$data2, _formCheckoutRef$curr3;
10697
10725
  setOrderSuccessInfo(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
10698
10726
  formCheckoutRef === null || formCheckoutRef === void 0 ? void 0 : (_formCheckoutRef$curr3 = formCheckoutRef.current) === null || _formCheckoutRef$curr3 === void 0 ? void 0 : _formCheckoutRef$curr3.setValue();
10727
+ var variantIdProducts = chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.map(function (item) {
10728
+ var _item$variant5;
10729
+ return item === null || item === void 0 ? void 0 : (_item$variant5 = item.variant) === null || _item$variant5 === void 0 ? void 0 : _item$variant5.variantId;
10730
+ });
10731
+ dispatch(removeFromCart(variantIdProducts));
10699
10732
  setIsOpenModal(true);
10700
10733
  setChosenProducts([]);
10701
10734
  }
@@ -10730,10 +10763,10 @@ var Carts1 = function Carts1(props) {
10730
10763
  }, "Th\xE0nh ti\u1EC1n"), /*#__PURE__*/React__default.createElement("div", {
10731
10764
  className: "min-w-32 text-center"
10732
10765
  }, "H\xE0nh \u0111\u1ED9ng")), cartItems === null || cartItems === void 0 ? void 0 : cartItems.map(function (item, index) {
10733
- var _item$variant5;
10766
+ var _item$variant6;
10734
10767
  return /*#__PURE__*/React__default.createElement(CartItem, {
10735
10768
  item: item,
10736
- key: item === null || item === void 0 ? void 0 : (_item$variant5 = item.variant) === null || _item$variant5 === void 0 ? void 0 : _item$variant5.variantId,
10769
+ key: item === null || item === void 0 ? void 0 : (_item$variant6 = item.variant) === null || _item$variant6 === void 0 ? void 0 : _item$variant6.variantId,
10737
10770
  chosenProducts: chosenProducts,
10738
10771
  onChange: function onChange(event) {
10739
10772
  handleCheckProducts(event);
@@ -10743,7 +10776,8 @@ var Carts1 = function Carts1(props) {
10743
10776
  removeFromCart: removeFromCart
10744
10777
  });
10745
10778
  })), /*#__PURE__*/React__default.createElement("div", {
10746
- className: "grid grid-cols-5 md:flex items-center md:gap-6 bg-bgSecondary mb-6 md:h-20 py-4 px-4 xl:px-20 sticky bottom-0"
10779
+ ref: shadowRef,
10780
+ className: "grid grid-cols-5 md:flex items-center md:gap-6 bg-bgSecondary mb-6 md:h-20 py-4 px-4 xl:px-20 sticky bottom-0 " + (isShadow ? "shadow-[0_-7px_8px_-3px_rgba(0,0,0,0.1)]" : "") + " "
10747
10781
  }, /*#__PURE__*/React__default.createElement("div", {
10748
10782
  className: "col-span-2 md:flex-1 flex gap-2 min-w-32"
10749
10783
  }, /*#__PURE__*/React__default.createElement("input", {
@@ -10804,10 +10838,10 @@ var Carts1 = function Carts1(props) {
10804
10838
  }, /*#__PURE__*/React__default.createElement("div", {
10805
10839
  className: "font-medium text-lg mb-6"
10806
10840
  }, "S\u1EA3n ph\u1EA9m trong \u0111\u01A1n (", chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.length, ")"), chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.map(function (item) {
10807
- var _item$variant6, _item$variant7, _item$variant8;
10841
+ var _item$variant7, _item$variant8, _item$variant9;
10808
10842
  return /*#__PURE__*/React__default.createElement("div", {
10809
10843
  className: "flex gap-6 border-t py-4",
10810
- key: item === null || item === void 0 ? void 0 : (_item$variant6 = item.variant) === null || _item$variant6 === void 0 ? void 0 : _item$variant6.variantId
10844
+ key: item === null || item === void 0 ? void 0 : (_item$variant7 = item.variant) === null || _item$variant7 === void 0 ? void 0 : _item$variant7.variantId
10811
10845
  }, /*#__PURE__*/React__default.createElement("img", {
10812
10846
  src: "https://img.freepik.com/free-photo/organic-cosmetic-product-with-dreamy-aesthetic-fresh-background_23-2151382816.jpg?semt=ais_hybrid",
10813
10847
  alt: "",
@@ -10818,11 +10852,11 @@ var Carts1 = function Carts1(props) {
10818
10852
  className: "font-medium"
10819
10853
  }, item === null || item === void 0 ? void 0 : item.productName), /*#__PURE__*/React__default.createElement("div", {
10820
10854
  className: "px-4 py-1 border border-stroke bg-gray6 rounded-md w-max"
10821
- }, item === null || item === void 0 ? void 0 : (_item$variant7 = item.variant) === null || _item$variant7 === void 0 ? void 0 : _item$variant7.name), /*#__PURE__*/React__default.createElement("div", {
10855
+ }, item === null || item === void 0 ? void 0 : (_item$variant8 = item.variant) === null || _item$variant8 === void 0 ? void 0 : _item$variant8.name), /*#__PURE__*/React__default.createElement("div", {
10822
10856
  className: "flex gap-4 items-center"
10823
10857
  }, /*#__PURE__*/React__default.createElement("div", {
10824
10858
  className: "text-primary text-lg font-medium"
10825
- }, formatCurrency(item === null || item === void 0 ? void 0 : (_item$variant8 = item.variant) === null || _item$variant8 === void 0 ? void 0 : _item$variant8.price)), /*#__PURE__*/React__default.createElement("div", null, "x", item === null || item === void 0 ? void 0 : item.quantity))));
10859
+ }, formatCurrency(item === null || item === void 0 ? void 0 : (_item$variant9 = item.variant) === null || _item$variant9 === void 0 ? void 0 : _item$variant9.price)), /*#__PURE__*/React__default.createElement("div", null, "x", item === null || item === void 0 ? void 0 : item.quantity))));
10826
10860
  })))), isOpenModal && /*#__PURE__*/React__default.createElement(ModalNotification, {
10827
10861
  isButtonClose: false
10828
10862
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10851,7 +10885,7 @@ var Carts1 = function Carts1(props) {
10851
10885
  }))));
10852
10886
  };
10853
10887
  var CartItem = function CartItem(props) {
10854
- var _item$variant10, _item$variant11, _item$variant12, _item$variant13;
10888
+ var _item$variant11, _item$variant12, _item$variant13, _item$variant14;
10855
10889
  var item = props.item,
10856
10890
  _props$onChange = props.onChange,
10857
10891
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
@@ -10859,9 +10893,9 @@ var CartItem = function CartItem(props) {
10859
10893
  dispatch = props.dispatch,
10860
10894
  removeFromCart = props.removeFromCart,
10861
10895
  updateQuantity = props.updateQuantity;
10862
- var _useState7 = React.useState(item === null || item === void 0 ? void 0 : item.quantity),
10863
- quantity = _useState7[0],
10864
- setQuantity = _useState7[1];
10896
+ var _useState8 = React.useState(item === null || item === void 0 ? void 0 : item.quantity),
10897
+ quantity = _useState8[0],
10898
+ setQuantity = _useState8[1];
10865
10899
  var refInputQuantity = React.useRef();
10866
10900
  var handleChangeQuantity = function handleChangeQuantity(item, text) {
10867
10901
  setQuantity(parseInt(text));
@@ -10881,10 +10915,10 @@ var CartItem = function CartItem(props) {
10881
10915
  }, /*#__PURE__*/React__default.createElement("input", {
10882
10916
  type: "checkbox",
10883
10917
  checked: chosenProducts === null || chosenProducts === void 0 ? void 0 : chosenProducts.some(function (element) {
10884
- var _element$variant2, _item$variant9;
10885
- return (element === null || element === void 0 ? void 0 : (_element$variant2 = element.variant) === null || _element$variant2 === void 0 ? void 0 : _element$variant2.variantId) === (item === null || item === void 0 ? void 0 : (_item$variant9 = item.variant) === null || _item$variant9 === void 0 ? void 0 : _item$variant9.variantId);
10918
+ var _element$variant2, _item$variant10;
10919
+ return (element === null || element === void 0 ? void 0 : (_element$variant2 = element.variant) === null || _element$variant2 === void 0 ? void 0 : _element$variant2.variantId) === (item === null || item === void 0 ? void 0 : (_item$variant10 = item.variant) === null || _item$variant10 === void 0 ? void 0 : _item$variant10.variantId);
10886
10920
  }),
10887
- value: item === null || item === void 0 ? void 0 : (_item$variant10 = item.variant) === null || _item$variant10 === void 0 ? void 0 : _item$variant10.variantId,
10921
+ value: item === null || item === void 0 ? void 0 : (_item$variant11 = item.variant) === null || _item$variant11 === void 0 ? void 0 : _item$variant11.variantId,
10888
10922
  onChange: onChange
10889
10923
  }), /*#__PURE__*/React__default.createElement("div", {
10890
10924
  className: "min-w-80 lg:flex-1"
@@ -10900,9 +10934,9 @@ var CartItem = function CartItem(props) {
10900
10934
  className: "leading-6 w-56 lg:w-full text-wrap line-clamp-2"
10901
10935
  }, item === null || item === void 0 ? void 0 : item.productName), /*#__PURE__*/React__default.createElement("div", {
10902
10936
  className: "border border-stroke rounded-md bg-gray6 px-4 py-1 w-max"
10903
- }, item === null || item === void 0 ? void 0 : (_item$variant11 = item.variant) === null || _item$variant11 === void 0 ? void 0 : _item$variant11.name)))), /*#__PURE__*/React__default.createElement("div", {
10937
+ }, item === null || item === void 0 ? void 0 : (_item$variant12 = item.variant) === null || _item$variant12 === void 0 ? void 0 : _item$variant12.name)))), /*#__PURE__*/React__default.createElement("div", {
10904
10938
  className: "min-w-32 text-right"
10905
- }, formatCurrency(item === null || item === void 0 ? void 0 : (_item$variant12 = item.variant) === null || _item$variant12 === void 0 ? void 0 : _item$variant12.price)), /*#__PURE__*/React__default.createElement("div", {
10939
+ }, formatCurrency(item === null || item === void 0 ? void 0 : (_item$variant13 = item.variant) === null || _item$variant13 === void 0 ? void 0 : _item$variant13.price)), /*#__PURE__*/React__default.createElement("div", {
10906
10940
  className: "min-w-32 text-right"
10907
10941
  }, /*#__PURE__*/React__default.createElement(Input, {
10908
10942
  rules: [{
@@ -10923,14 +10957,14 @@ var CartItem = function CartItem(props) {
10923
10957
  wrapClassName: "w-fit mx-auto"
10924
10958
  })), /*#__PURE__*/React__default.createElement("div", {
10925
10959
  className: "min-w-32 text-right"
10926
- }, formatCurrency((item === null || item === void 0 ? void 0 : (_item$variant13 = item.variant) === null || _item$variant13 === void 0 ? void 0 : _item$variant13.price) * quantity)), /*#__PURE__*/React__default.createElement("div", {
10960
+ }, formatCurrency((item === null || item === void 0 ? void 0 : (_item$variant14 = item.variant) === null || _item$variant14 === void 0 ? void 0 : _item$variant14.price) * quantity)), /*#__PURE__*/React__default.createElement("div", {
10927
10961
  className: "min-w-32 flex justify-center "
10928
10962
  }, /*#__PURE__*/React__default.createElement("button", {
10929
10963
  type: "button",
10930
10964
  className: "flex items-center gap-2 text-danger",
10931
10965
  onClick: function onClick() {
10932
- var _item$variant14;
10933
- handleRemoveProduct(item === null || item === void 0 ? void 0 : (_item$variant14 = item.variant) === null || _item$variant14 === void 0 ? void 0 : _item$variant14.variantId);
10966
+ var _item$variant15;
10967
+ handleRemoveProduct(item === null || item === void 0 ? void 0 : (_item$variant15 = item.variant) === null || _item$variant15 === void 0 ? void 0 : _item$variant15.variantId);
10934
10968
  }
10935
10969
  }, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin7Line, null), /*#__PURE__*/React__default.createElement("span", null, "X\xF3a"))));
10936
10970
  };
@@ -10940,6 +10974,7 @@ exports.Address1 = Address1;
10940
10974
  exports.Banner1 = Banner1;
10941
10975
  exports.Booking1 = Booking1;
10942
10976
  exports.Breadcrumb1 = Breadcrumb1;
10977
+ exports.Button = Button;
10943
10978
  exports.Carts1 = Carts1;
10944
10979
  exports.Contact1 = Contact1;
10945
10980
  exports.CustomerRating10 = CustomerRating10;
@@ -10954,6 +10989,8 @@ exports.Hero10 = Hero10;
10954
10989
  exports.Hero11 = Hero11;
10955
10990
  exports.Hero12 = Hero11$1;
10956
10991
  exports.Hero13 = Hero13;
10992
+ exports.Input = Input;
10993
+ exports.InputPhoneNumber = InputPhoneNumber;
10957
10994
  exports.Links1 = Links1;
10958
10995
  exports.NavBar7 = NavBar7;
10959
10996
  exports.PageTitle1 = PageTitle1;
@@ -10967,6 +11004,7 @@ exports.Products2 = Products2;
10967
11004
  exports.Products3 = Products3;
10968
11005
  exports.ProductsTop1 = ProductsTop1;
10969
11006
  exports.SectionTitle1 = SectionTitle1;
11007
+ exports.Select = Select$1;
10970
11008
  exports.ServiceDetail1 = ServiceDetail1;
10971
11009
  exports.Treatments1 = Treatments1;
10972
11010
  exports.Treatments2 = Treatments1$1;