s-platform-landing-section 0.1.14 → 0.1.15

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
@@ -15,6 +15,9 @@ var bs = require('react-icons/bs');
15
15
  var lu = require('react-icons/lu');
16
16
  var DatePicker = _interopDefault(require('react-datepicker'));
17
17
  require('react-datepicker/dist/react-datepicker.css');
18
+ var Slider = _interopDefault(require('react-slick'));
19
+ require('slick-carousel/slick/slick.css');
20
+ require('slick-carousel/slick/slick-theme.css');
18
21
  var ai = require('react-icons/ai');
19
22
  var go = require('react-icons/go');
20
23
  var ri = require('react-icons/ri');
@@ -649,9 +652,9 @@ var SvgIcon = function SvgIcon(_ref) {
649
652
  var SectionTitle1 = function SectionTitle1(props) {
650
653
  var _props$data = props.data,
651
654
  data = _props$data === void 0 ? {} : _props$data;
652
- return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement("div", {
655
+ return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
653
656
  className: "text-center text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
654
- }, data === null || data === void 0 ? void 0 : data.sectionTitle) : null, /*#__PURE__*/React__default.createElement("div", {
657
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
655
658
  className: "flex items-center justify-center"
656
659
  }, /*#__PURE__*/React__default.createElement("div", {
657
660
  className: "w-32 h-0.5 rounded-full bg-secondary"
@@ -659,7 +662,7 @@ var SectionTitle1 = function SectionTitle1(props) {
659
662
  className: "w-9 h-9 text-secondary"
660
663
  }), /*#__PURE__*/React__default.createElement("div", {
661
664
  className: " w-32 h-0.5 rounded-full bg-secondary"
662
- })), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
665
+ }))) : null, data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
663
666
  className: "text-xl font-medium text-center leading-relaxed text-textSecondary"
664
667
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
665
668
  };
@@ -7646,6 +7649,11 @@ var pattern = {
7646
7649
  phoneNumberPattern: /^(?:\+84|0)\d{9}$/
7647
7650
  };
7648
7651
  var numberPattern = /^\d+$/;
7652
+ var getYoutubeVideoIdByUrl = function getYoutubeVideoIdByUrl(url) {
7653
+ var regex = /(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/|youtube\.com\/shorts\/)([a-zA-Z0-9_-]{11})/;
7654
+ var match = url === null || url === void 0 ? void 0 : url.match(regex);
7655
+ return match ? match[1] : null;
7656
+ };
7649
7657
 
7650
7658
  function getMinMax(array, field) {
7651
7659
  if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
@@ -9029,6 +9037,9 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9029
9037
  var _useState3 = React.useState([]),
9030
9038
  dataBooking = _useState3[0],
9031
9039
  setDataBooking = _useState3[1];
9040
+ var _useState4 = React.useState(0),
9041
+ currentSlide = _useState4[0],
9042
+ setCurrentSlide = _useState4[1];
9032
9043
  var _ProductController = ProductController(_extends({}, props, {
9033
9044
  params: params
9034
9045
  })),
@@ -9055,23 +9066,18 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9055
9066
  setIsOpenModal(false);
9056
9067
  setDataBooking([]);
9057
9068
  };
9058
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9059
- className: "" + SECTION_DEFAULT_CLASS
9060
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9061
- data: data,
9062
- shopConfigStyle: shopConfigStyle
9063
- }), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9069
+ var renderItemSlide = function renderItemSlide(product, index) {
9064
9070
  var _product$productInfo, _product$productInfo2;
9065
9071
  return /*#__PURE__*/React__default.createElement("div", {
9066
- className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
9067
- key: "rthirr-" + index
9072
+ className: "w-full"
9068
9073
  }, /*#__PURE__*/React__default.createElement("div", {
9069
- className: "block " + (index % 2 ? "md:hidden" : "")
9074
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
9075
+ key: index
9070
9076
  }, /*#__PURE__*/React__default.createElement(ProductImage, {
9071
9077
  product: product === null || product === void 0 ? void 0 : product.productInfo,
9072
9078
  className: "aspect-video rounded-2xl"
9073
- })), /*#__PURE__*/React__default.createElement("div", {
9074
- className: "text-left " + (index % 2 ? "md:text-right" : "")
9079
+ }), /*#__PURE__*/React__default.createElement("div", {
9080
+ className: ''
9075
9081
  }, /*#__PURE__*/React__default.createElement("div", {
9076
9082
  className: "font-medium text-2xl"
9077
9083
  }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
@@ -9086,13 +9092,49 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9086
9092
  onClick: function onClick(event) {
9087
9093
  handleOpenModalBooking(event, product);
9088
9094
  }
9089
- })), /*#__PURE__*/React__default.createElement("div", {
9090
- className: "hidden " + (index % 2 ? "md:block" : "")
9091
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
9092
- product: product === null || product === void 0 ? void 0 : product.productInfo,
9093
- className: "aspect-video rounded-2xl"
9094
- })));
9095
- })), /*#__PURE__*/React__default.createElement(Dash, {
9095
+ }))));
9096
+ };
9097
+ function RenderArrow(props) {
9098
+ var className = props.className,
9099
+ style = props.style,
9100
+ onClick = props.onClick;
9101
+ return /*#__PURE__*/React__default.createElement("div", {
9102
+ className: className,
9103
+ style: _extends({}, style, {
9104
+ display: "none"
9105
+ }),
9106
+ onClick: onClick
9107
+ });
9108
+ }
9109
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9110
+ className: "" + SECTION_DEFAULT_CLASS
9111
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9112
+ data: data,
9113
+ shopConfigStyle: shopConfigStyle
9114
+ }), /*#__PURE__*/React__default.createElement(Slider, {
9115
+ className: "center",
9116
+ infinite: true,
9117
+ slidesToShow: 1,
9118
+ speed: 500,
9119
+ autoplay: true,
9120
+ autoplaySpeed: 4000,
9121
+ pauseOnHover: true,
9122
+ nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9123
+ prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9124
+ beforeChange: function beforeChange(oldIndex, newIndex) {
9125
+ return setCurrentSlide(newIndex);
9126
+ },
9127
+ dots: true,
9128
+ customPaging: function customPaging(i) {
9129
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
9130
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
9131
+ }) : /*#__PURE__*/React__default.createElement("div", {
9132
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
9133
+ });
9134
+ }
9135
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9136
+ return renderItemSlide(product, index);
9137
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
9096
9138
  color: secondary
9097
9139
  }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
9098
9140
  onClose: handleCloseModal
@@ -10656,6 +10698,72 @@ var Banner1 = function Banner1(props) {
10656
10698
  })));
10657
10699
  };
10658
10700
 
10701
+ var Banner2 = function Banner2(props) {
10702
+ var data = props.data,
10703
+ shopConfigStyle = props.shopConfigStyle,
10704
+ _props$SectionTitle = props.SectionTitle,
10705
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10706
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
10707
+ var _useState = React.useState(0),
10708
+ currentSlide = _useState[0],
10709
+ setCurrentSlide = _useState[1];
10710
+ function RenderArrow(props) {
10711
+ var className = props.className,
10712
+ style = props.style,
10713
+ onClick = props.onClick;
10714
+ return /*#__PURE__*/React__default.createElement("div", {
10715
+ className: className,
10716
+ style: _extends({}, style, {
10717
+ display: "none"
10718
+ }),
10719
+ onClick: onClick
10720
+ });
10721
+ }
10722
+ return /*#__PURE__*/React__default.createElement("div", {
10723
+ className: "" + SECTION_DEFAULT_CLASS
10724
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10725
+ data: data,
10726
+ shopConfigStyle: shopConfigStyle
10727
+ }), /*#__PURE__*/React__default.createElement(Slider, {
10728
+ className: "center",
10729
+ infinite: false,
10730
+ slidesToShow: 2,
10731
+ speed: 500,
10732
+ autoplay: true,
10733
+ autoplaySpeed: 4000,
10734
+ pauseOnHover: true,
10735
+ nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
10736
+ prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
10737
+ beforeChange: function beforeChange(oldIndex, newIndex) {
10738
+ return setCurrentSlide(newIndex);
10739
+ },
10740
+ dots: true,
10741
+ customPaging: function customPaging(i) {
10742
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
10743
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
10744
+ }) : /*#__PURE__*/React__default.createElement("div", {
10745
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
10746
+ });
10747
+ },
10748
+ centerPadding: "20px",
10749
+ responsive: [{
10750
+ breakpoint: 600,
10751
+ settings: {
10752
+ slidesToShow: 1
10753
+ }
10754
+ }]
10755
+ }, (sectionData === null || sectionData === void 0 ? void 0 : sectionData.length) > 0 && (sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10756
+ return /*#__PURE__*/React__default.createElement("div", {
10757
+ className: 'px-2'
10758
+ }, /*#__PURE__*/React__default.createElement("img", {
10759
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
10760
+ alt: "",
10761
+ className: "rounded-2xl",
10762
+ key: index
10763
+ }));
10764
+ }))));
10765
+ };
10766
+
10659
10767
  var Banner3 = function Banner3(props) {
10660
10768
  var data = props.data;
10661
10769
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
@@ -12750,10 +12858,37 @@ var ShopHighlights7 = function ShopHighlights7(props) {
12750
12858
  }));
12751
12859
  };
12752
12860
 
12861
+ var VideoFull1 = function VideoFull1(props) {
12862
+ var _data$data, _data$data$;
12863
+ var shopConfigStyle = props.shopConfigStyle,
12864
+ data = props.data,
12865
+ _props$SectionTitle = props.SectionTitle,
12866
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
12867
+ console.log("VideoFull1 data", data);
12868
+ var youtubeVideoId = getYoutubeVideoIdByUrl(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.link);
12869
+ console.log("VideoFull1 youtubeVideoId", youtubeVideoId);
12870
+ return /*#__PURE__*/React__default.createElement("div", {
12871
+ className: "" + SECTION_DEFAULT_CLASS
12872
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
12873
+ data: data,
12874
+ shopConfigStyle: shopConfigStyle
12875
+ }), youtubeVideoId ? /*#__PURE__*/React__default.createElement("div", {
12876
+ className: "w-full aspect-video"
12877
+ }, /*#__PURE__*/React__default.createElement("iframe", {
12878
+ className: "w-full h-full",
12879
+ src: "https://www.youtube.com/embed/" + youtubeVideoId,
12880
+ title: "YouTube video player",
12881
+ frameBorder: "0",
12882
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
12883
+ allowFullScreen: true
12884
+ })) : null);
12885
+ };
12886
+
12753
12887
  exports.About1 = About1;
12754
12888
  exports.About5 = About5;
12755
12889
  exports.Address1 = Address1;
12756
12890
  exports.Banner1 = Banner1;
12891
+ exports.Banner2 = Banner2;
12757
12892
  exports.Banner3 = Banner3;
12758
12893
  exports.Banner7 = Banner7;
12759
12894
  exports.BannerFull1 = BannerFull1;
@@ -12828,4 +12963,5 @@ exports.TreatmentItem1 = TreatmentItem1;
12828
12963
  exports.TreatmentsCategory7 = TreatmentsCategory7;
12829
12964
  exports.TreatmentsList6 = TreatmentsList6;
12830
12965
  exports.TreatmentsList7 = TreatmentsList7;
12966
+ exports.VideoFull1 = VideoFull1;
12831
12967
  //# sourceMappingURL=index.js.map