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