s-platform-landing-section 0.1.9 → 0.1.10-alpha.2

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.
@@ -1,12 +1,11 @@
1
- import React__default, { useState, useEffect, useRef, createElement, forwardRef, useImperativeHandle } from 'react';
2
- import { useSelector } from 'react-redux';
3
- import { FaPhone, FaChevronLeft, FaChevronRight, FaArrowLeft, FaArrowRight as FaArrowRight$1, FaFacebookSquare, FaFacebookMessenger } from 'react-icons/fa';
4
- import { IoLocationOutline } from 'react-icons/io5';
1
+ import React__default, { useRef, useState, useEffect, createElement, forwardRef, useImperativeHandle } from 'react';
2
+ import { IoCartOutline, IoLocationOutline } from 'react-icons/io5';
3
+ import { FaUserCircle, FaPhone, FaChevronLeft, FaChevronRight, FaArrowLeft, FaArrowRight as FaArrowRight$1, FaFacebookSquare, FaFacebookMessenger } from 'react-icons/fa';
4
+ import { FiMenu } from 'react-icons/fi';
5
+ import { RxCross2 } from 'react-icons/rx';
5
6
  import { PiHandbagSimpleLight } from 'react-icons/pi';
6
7
  import { CiSearch } from 'react-icons/ci';
7
8
  import { BsFilterLeft, BsCurrencyDollar } from 'react-icons/bs';
8
- import { FiMenu } from 'react-icons/fi';
9
- import { RxCross2 } from 'react-icons/rx';
10
9
  import DatePicker from 'react-datepicker';
11
10
  import 'react-datepicker/dist/react-datepicker.css';
12
11
  import { FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
@@ -15,6 +14,236 @@ import 'react-icons/io';
15
14
  import { SiVisa, SiZalo } from 'react-icons/si';
16
15
  import { GoCreditCard } from 'react-icons/go';
17
16
 
17
+ function _extends() {
18
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
19
+ for (var e = 1; e < arguments.length; e++) {
20
+ var t = arguments[e];
21
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
22
+ }
23
+ return n;
24
+ }, _extends.apply(null, arguments);
25
+ }
26
+ function _objectDestructuringEmpty(t) {
27
+ if (null == t) throw new TypeError("Cannot destructure " + t);
28
+ }
29
+ function _objectWithoutPropertiesLoose(r, e) {
30
+ if (null == r) return {};
31
+ var t = {};
32
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
33
+ if (e.includes(n)) continue;
34
+ t[n] = r[n];
35
+ }
36
+ return t;
37
+ }
38
+
39
+ var Button = function Button(props) {
40
+ var _shopConfigStyle$colo;
41
+ var _props$label = props.label,
42
+ label = _props$label === void 0 ? "" : _props$label,
43
+ _props$className = props.className,
44
+ className = _props$className === void 0 ? "" : _props$className,
45
+ _props$style = props.style,
46
+ style = _props$style === void 0 ? {} : _props$style,
47
+ _props$shopConfigStyl = props.shopConfigStyle,
48
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
49
+ _props$onClick = props.onClick,
50
+ onClick = _props$onClick === void 0 ? function () {} : _props$onClick;
51
+ var _className = "text-white font-medium rounded-lg text-sm px-4 py-2.5 " + ((shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) || "") + " " + className;
52
+ var _style = _extends({
53
+ backgroundColor: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo = shopConfigStyle.color) === null || _shopConfigStyle$colo === void 0 ? void 0 : _shopConfigStyle$colo.primary
54
+ }, style);
55
+ return /*#__PURE__*/React__default.createElement("button", {
56
+ type: "button",
57
+ className: _className,
58
+ style: _style,
59
+ onClick: onClick
60
+ }, label);
61
+ };
62
+
63
+ var NavBar7 = function NavBar7(props) {
64
+ var listRef = useRef(null);
65
+ var _useState = useState(false),
66
+ isOpen = _useState[0],
67
+ setIsOpen = _useState[1];
68
+ var _props$shopConfig = props.shopConfig,
69
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
70
+ shopConfigStyle = props.shopConfigStyle,
71
+ _props$routes = props.routes,
72
+ routes = _props$routes === void 0 ? [] : _props$routes,
73
+ _props$section = props.section,
74
+ section = _props$section === void 0 ? {} : _props$section,
75
+ _props$userInfo = props.userInfo,
76
+ userInfo = _props$userInfo === void 0 ? null : _props$userInfo,
77
+ _props$cartItems = props.cartItems,
78
+ cartItems = _props$cartItems === void 0 ? [] : _props$cartItems,
79
+ _props$navToLogin = props.navToLogin,
80
+ navToLogin = _props$navToLogin === void 0 ? function () {} : _props$navToLogin,
81
+ _props$navToRegister = props.navToRegister,
82
+ navToRegister = _props$navToRegister === void 0 ? function () {} : _props$navToRegister;
83
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
84
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
85
+ primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
86
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
87
+ textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
88
+ _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
89
+ textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
90
+ _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
91
+ background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
92
+ _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
93
+ bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6,
94
+ _shopConfigStyle$colo7 = _shopConfigStyle$colo.textButton,
95
+ textButton = _shopConfigStyle$colo7 === void 0 ? "#fff" : _shopConfigStyle$colo7;
96
+ console.log("NavBar7 routes", routes);
97
+ console.log("NavBar7 userInfo", userInfo);
98
+ console.log("NavBar7 cartItems", cartItems);
99
+ var totalItem = cartItems.reduce(function (total, item) {
100
+ return total + item.quantity;
101
+ }, 0);
102
+ if (totalItem > 9) {
103
+ totalItem = "9+";
104
+ }
105
+ var cart = function cart() {
106
+ return /*#__PURE__*/React__default.createElement("div", {
107
+ className: "flex"
108
+ }, /*#__PURE__*/React__default.createElement("div", {
109
+ className: "relative cursor-pointer"
110
+ }, /*#__PURE__*/React__default.createElement(IoCartOutline, {
111
+ style: {
112
+ fontSize: "30px",
113
+ color: primary
114
+ }
115
+ }), totalItem ? /*#__PURE__*/React__default.createElement("small", {
116
+ className: "absolute aspect-square flex items-center bg-danger px-[2px] text-xs rounded-full",
117
+ style: {
118
+ color: textButton,
119
+ top: 0,
120
+ right: 0
121
+ }
122
+ }, totalItem) : null));
123
+ };
124
+ return /*#__PURE__*/React__default.createElement("div", {
125
+ className: "w-full sticky top-0 shadow z-50",
126
+ style: {
127
+ background: background
128
+ }
129
+ }, /*#__PURE__*/React__default.createElement("div", {
130
+ className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20",
131
+ style: {
132
+ color: textBody
133
+ }
134
+ }, /*#__PURE__*/React__default.createElement("a", {
135
+ href: "/",
136
+ className: "flex items-center gap-2"
137
+ }, /*#__PURE__*/React__default.createElement("img", {
138
+ className: "object-cover w-12 h-12",
139
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
140
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
141
+ }), /*#__PURE__*/React__default.createElement("h3", {
142
+ className: "text-xl md:text-2xl whitespace-nowrap font-semibold",
143
+ style: {
144
+ color: primary
145
+ }
146
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
147
+ className: "hidden lg:flex flex-1 items-center gap-4"
148
+ }, routes === null || routes === void 0 ? void 0 : routes.map(function (route, index) {
149
+ return /*#__PURE__*/React__default.createElement("a", {
150
+ href: route === null || route === void 0 ? void 0 : route.route
151
+ }, (section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
152
+ className: "py-1 border-b",
153
+ style: {
154
+ color: textHeading,
155
+ borderColor: textHeading
156
+ }
157
+ }, route === null || route === void 0 ? void 0 : route.label) : /*#__PURE__*/React__default.createElement("div", {
158
+ className: "py-1"
159
+ }, route === null || route === void 0 ? void 0 : route.label));
160
+ })), cart(), !userInfo ?
161
+ /*#__PURE__*/
162
+ React__default.createElement("div", {
163
+ className: "flex justify-center"
164
+ }, /*#__PURE__*/React__default.createElement(FaUserCircle, {
165
+ color: "#fff",
166
+ size: 48
167
+ }), /*#__PURE__*/React__default.createElement("div", {
168
+ className: "flex flex-col ml-2"
169
+ }, /*#__PURE__*/React__default.createElement("label", null, "Xin ch\xE0o!"), /*#__PURE__*/React__default.createElement("label", {
170
+ className: "font-semibold"
171
+ }, userInfo === null || userInfo === void 0 ? void 0 : userInfo.name, "Nguyen Thanh Tung"))) :
172
+ /*#__PURE__*/
173
+ React__default.createElement("div", {
174
+ className: "flex gap-2"
175
+ }, /*#__PURE__*/React__default.createElement(Button, {
176
+ label: "Đăng nhập",
177
+ shopConfigStyle: shopConfigStyle,
178
+ onClick: function onClick() {
179
+ return navToLogin();
180
+ }
181
+ }), /*#__PURE__*/React__default.createElement(Button, {
182
+ label: "Đăng ký",
183
+ shopConfigStyle: shopConfigStyle,
184
+ style: {
185
+ backgroundColor: "transparent",
186
+ borderColor: primary,
187
+ color: primary
188
+ },
189
+ className: "border",
190
+ onClick: function onClick() {
191
+ return navToRegister();
192
+ }
193
+ }))), /*#__PURE__*/React__default.createElement("div", {
194
+ className: "relative lg:hidden flex gap-4 items-center px-4 py-2"
195
+ }, /*#__PURE__*/React__default.createElement("a", {
196
+ href: "/",
197
+ className: "flex flex-1 gap-2 items-center"
198
+ }, /*#__PURE__*/React__default.createElement("img", {
199
+ className: "object-cover w-12 h-12",
200
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
201
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
202
+ }), /*#__PURE__*/React__default.createElement("h3", {
203
+ className: "text-xl md:text-2xl font-semibold",
204
+ style: {
205
+ color: primary
206
+ }
207
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
208
+ type: "button",
209
+ onClick: function onClick() {
210
+ setIsOpen(true);
211
+ }
212
+ }, /*#__PURE__*/React__default.createElement(FiMenu, {
213
+ size: 32,
214
+ color: primary
215
+ })), isOpen ? /*#__PURE__*/React__default.createElement("div", {
216
+ className: "absolute bg-[rgba(0,0,0,0.5)] h-screen w-full top-0 left-0 z-50 flex justify-end",
217
+ onClick: function onClick() {
218
+ setIsOpen(false);
219
+ }
220
+ }, /*#__PURE__*/React__default.createElement("div", {
221
+ className: "h-full w-[80vw] max-w-[320px] p-4",
222
+ style: {
223
+ background: bgSecondary
224
+ },
225
+ onClick: function onClick(event) {
226
+ return event.stopPropagation();
227
+ }
228
+ }, /*#__PURE__*/React__default.createElement("button", {
229
+ className: "flex w-full justify-end text-gray4",
230
+ onClick: function onClick() {
231
+ setIsOpen(false);
232
+ }
233
+ }, /*#__PURE__*/React__default.createElement(RxCross2, {
234
+ size: 24
235
+ })), /*#__PURE__*/React__default.createElement("div", null, routes === null || routes === void 0 ? void 0 : routes.map(function (route, index) {
236
+ return /*#__PURE__*/React__default.createElement("a", {
237
+ href: route === null || route === void 0 ? void 0 : route.route
238
+ }, /*#__PURE__*/React__default.createElement("div", {
239
+ className: "py-2",
240
+ style: (section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? {
241
+ color: textHeading
242
+ } : null
243
+ }, route === null || route === void 0 ? void 0 : route.label));
244
+ })))) : null, cart()));
245
+ };
246
+
18
247
  var SvgIcon = function SvgIcon(_ref) {
19
248
  var className = _ref.className,
20
249
  style = _ref.style;
@@ -79,61 +308,11 @@ var SectionTitle1 = function SectionTitle1(props) {
79
308
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
80
309
  };
81
310
 
82
- function _extends() {
83
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
84
- for (var e = 1; e < arguments.length; e++) {
85
- var t = arguments[e];
86
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
87
- }
88
- return n;
89
- }, _extends.apply(null, arguments);
90
- }
91
- function _objectDestructuringEmpty(t) {
92
- if (null == t) throw new TypeError("Cannot destructure " + t);
93
- }
94
- function _objectWithoutPropertiesLoose(r, e) {
95
- if (null == r) return {};
96
- var t = {};
97
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
98
- if (e.includes(n)) continue;
99
- t[n] = r[n];
100
- }
101
- return t;
102
- }
103
-
104
- var Button = function Button(props) {
105
- var _shopConfigStyle$colo;
106
- var _props$label = props.label,
107
- label = _props$label === void 0 ? "" : _props$label,
108
- _props$className = props.className,
109
- className = _props$className === void 0 ? "" : _props$className,
110
- _props$style = props.style,
111
- style = _props$style === void 0 ? {} : _props$style,
112
- _props$shopConfigStyl = props.shopConfigStyle,
113
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
114
- _props$onClick = props.onClick,
115
- onClick = _props$onClick === void 0 ? function () {} : _props$onClick;
116
- var _className = "text-white font-medium rounded-lg text-sm px-4 py-2.5 " + ((shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) || "") + " " + className;
117
- var _style = _extends({
118
- backgroundColor: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo = shopConfigStyle.color) === null || _shopConfigStyle$colo === void 0 ? void 0 : _shopConfigStyle$colo.primary
119
- }, style);
120
- return /*#__PURE__*/React__default.createElement("button", {
121
- type: "button",
122
- className: _className,
123
- style: _style,
124
- onClick: onClick
125
- }, label);
126
- };
127
-
128
311
  var Hero10 = function Hero10(props) {
129
312
  var _data$data, _data$data$, _data$data$$srcImages, _sectionData$, _sectionData$2, _sectionData$2$button;
130
313
  var shopConfigStyle = props.shopConfigStyle,
131
314
  data = props.data;
132
315
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
133
- var count = useSelector(function (state) {
134
- var _state$counter;
135
- return state === null || state === void 0 ? void 0 : (_state$counter = state.counter) === null || _state$counter === void 0 ? void 0 : _state$counter.value;
136
- });
137
316
  return /*#__PURE__*/React__default.createElement("div", {
138
317
  className: "relative w-full bg-cover bg-center bg-no-repeat ",
139
318
  style: {
@@ -1572,12 +1751,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1572
1751
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1573
1752
 
1574
1753
  var utils$1 = {
1575
- __proto__: null,
1576
- hasBrowserEnv: hasBrowserEnv,
1577
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1578
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1579
- navigator: _navigator,
1580
- origin: origin
1754
+ __proto__: null,
1755
+ hasBrowserEnv: hasBrowserEnv,
1756
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1757
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1758
+ navigator: _navigator,
1759
+ origin: origin
1581
1760
  };
1582
1761
 
1583
1762
  var platform$1 = {
@@ -4716,8 +4895,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
4716
4895
  var _nodeResolve_empty = {};
4717
4896
 
4718
4897
  var _nodeResolve_empty$1 = {
4719
- __proto__: null,
4720
- 'default': _nodeResolve_empty
4898
+ __proto__: null,
4899
+ 'default': _nodeResolve_empty
4721
4900
  };
4722
4901
 
4723
4902
  var utilInspect = getCjsExportFromNamespace(_nodeResolve_empty$1);
@@ -6920,7 +7099,7 @@ var ProductImage = function ProductImage(props) {
6920
7099
  };
6921
7100
  return src ? /*#__PURE__*/React__default.createElement("img", {
6922
7101
  src: src,
6923
- className: className,
7102
+ className: "w-full aspect-square " + className,
6924
7103
  style: size ? {
6925
7104
  width: size,
6926
7105
  height: size
@@ -8431,5 +8610,5 @@ var Gallery1 = function Gallery1(props) {
8431
8610
  }));
8432
8611
  };
8433
8612
 
8434
- export { Address1, Banner1, Booking1, CustomerRating10, Employees1, Features1, Features2, Features3, Footer1, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Links1, Partner1, Products1, Products10, Products2, ProductsTop1, SectionTitle1, Treatments1, Treatments1$1 as Treatments2 };
8613
+ export { Address1, Banner1, Booking1, CustomerRating10, Employees1, Features1, Features2, Features3, Footer1, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Links1, NavBar7, Partner1, Products1, Products10, Products2, ProductsTop1, SectionTitle1, Treatments1, Treatments1$1 as Treatments2 };
8435
8614
  //# sourceMappingURL=index.modern.js.map