s-platform-landing-section 0.1.8 → 0.1.10-alpha.1

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
@@ -2,14 +2,13 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
2
2
 
3
3
  var React = require('react');
4
4
  var React__default = _interopDefault(React);
5
- var reactRedux = require('react-redux');
6
- var fa = require('react-icons/fa');
7
5
  var io5 = require('react-icons/io5');
6
+ var fa = require('react-icons/fa');
7
+ var fi = require('react-icons/fi');
8
+ var rx = require('react-icons/rx');
8
9
  var pi = require('react-icons/pi');
9
10
  var ci = require('react-icons/ci');
10
11
  var bs = require('react-icons/bs');
11
- var fi = require('react-icons/fi');
12
- var rx = require('react-icons/rx');
13
12
  var DatePicker = _interopDefault(require('react-datepicker'));
14
13
  require('react-datepicker/dist/react-datepicker.css');
15
14
  var fa6 = require('react-icons/fa6');
@@ -18,6 +17,233 @@ require('react-icons/io');
18
17
  var si = require('react-icons/si');
19
18
  var go = require('react-icons/go');
20
19
 
20
+ function _extends() {
21
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
22
+ for (var e = 1; e < arguments.length; e++) {
23
+ var t = arguments[e];
24
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
25
+ }
26
+ return n;
27
+ }, _extends.apply(null, arguments);
28
+ }
29
+ function _objectDestructuringEmpty(t) {
30
+ if (null == t) throw new TypeError("Cannot destructure " + t);
31
+ }
32
+ function _objectWithoutPropertiesLoose(r, e) {
33
+ if (null == r) return {};
34
+ var t = {};
35
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
36
+ if (e.includes(n)) continue;
37
+ t[n] = r[n];
38
+ }
39
+ return t;
40
+ }
41
+
42
+ var Button = function Button(props) {
43
+ var _shopConfigStyle$colo;
44
+ var _props$label = props.label,
45
+ label = _props$label === void 0 ? "" : _props$label,
46
+ _props$className = props.className,
47
+ className = _props$className === void 0 ? "" : _props$className,
48
+ _props$style = props.style,
49
+ style = _props$style === void 0 ? {} : _props$style,
50
+ _props$shopConfigStyl = props.shopConfigStyle,
51
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
52
+ _props$onClick = props.onClick,
53
+ onClick = _props$onClick === void 0 ? function () {} : _props$onClick;
54
+ 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;
55
+ var _style = _extends({
56
+ backgroundColor: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo = shopConfigStyle.color) === null || _shopConfigStyle$colo === void 0 ? void 0 : _shopConfigStyle$colo.primary
57
+ }, style);
58
+ return /*#__PURE__*/React__default.createElement("button", {
59
+ type: "button",
60
+ className: _className,
61
+ style: _style,
62
+ onClick: onClick
63
+ }, label);
64
+ };
65
+
66
+ var NavBar7 = function NavBar7(props) {
67
+ var listRef = React.useRef(null);
68
+ var _useState = React.useState(false),
69
+ isOpen = _useState[0],
70
+ setIsOpen = _useState[1];
71
+ var _props$shopConfig = props.shopConfig,
72
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
73
+ shopConfigStyle = props.shopConfigStyle,
74
+ _props$routes = props.routes,
75
+ routes = _props$routes === void 0 ? [] : _props$routes,
76
+ _props$section = props.section,
77
+ section = _props$section === void 0 ? {} : _props$section,
78
+ _props$userInfo = props.userInfo,
79
+ userInfo = _props$userInfo === void 0 ? null : _props$userInfo,
80
+ _props$cartItems = props.cartItems,
81
+ cartItems = _props$cartItems === void 0 ? [] : _props$cartItems,
82
+ _props$navToLogin = props.navToLogin,
83
+ navToLogin = _props$navToLogin === void 0 ? function () {} : _props$navToLogin,
84
+ _props$navToRegister = props.navToRegister,
85
+ navToRegister = _props$navToRegister === void 0 ? function () {} : _props$navToRegister;
86
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
87
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
88
+ primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
89
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
90
+ textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
91
+ _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
92
+ textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
93
+ _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
94
+ background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
95
+ _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
96
+ bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6,
97
+ _shopConfigStyle$colo7 = _shopConfigStyle$colo.textButton,
98
+ textButton = _shopConfigStyle$colo7 === void 0 ? "#fff" : _shopConfigStyle$colo7;
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(io5.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(fa.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(fi.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(rx.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
+
21
247
  var SvgIcon = function SvgIcon(_ref) {
22
248
  var className = _ref.className,
23
249
  style = _ref.style;
@@ -82,60 +308,11 @@ var SectionTitle1 = function SectionTitle1(props) {
82
308
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
83
309
  };
84
310
 
85
- function _extends() {
86
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
87
- for (var e = 1; e < arguments.length; e++) {
88
- var t = arguments[e];
89
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
90
- }
91
- return n;
92
- }, _extends.apply(null, arguments);
93
- }
94
- function _objectDestructuringEmpty(t) {
95
- if (null == t) throw new TypeError("Cannot destructure " + t);
96
- }
97
- function _objectWithoutPropertiesLoose(r, e) {
98
- if (null == r) return {};
99
- var t = {};
100
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
101
- if (e.includes(n)) continue;
102
- t[n] = r[n];
103
- }
104
- return t;
105
- }
106
-
107
- var Button = function Button(props) {
108
- var _shopConfigStyle$colo;
109
- var _props$label = props.label,
110
- label = _props$label === void 0 ? "" : _props$label,
111
- _props$className = props.className,
112
- className = _props$className === void 0 ? "" : _props$className,
113
- _props$style = props.style,
114
- style = _props$style === void 0 ? {} : _props$style,
115
- _props$shopConfigStyl = props.shopConfigStyle,
116
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
117
- _props$onClick = props.onClick,
118
- onClick = _props$onClick === void 0 ? function () {} : _props$onClick;
119
- 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;
120
- var _style = _extends({
121
- backgroundColor: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo = shopConfigStyle.color) === null || _shopConfigStyle$colo === void 0 ? void 0 : _shopConfigStyle$colo.primary
122
- }, style);
123
- return /*#__PURE__*/React__default.createElement("button", {
124
- type: "button",
125
- className: _className,
126
- style: _style,
127
- onClick: onClick
128
- }, label);
129
- };
130
-
131
311
  var Hero10 = function Hero10(props) {
132
312
  var _data$data, _data$data$, _data$data$$srcImages, _sectionData$, _sectionData$2, _sectionData$2$button;
133
313
  var shopConfigStyle = props.shopConfigStyle,
134
314
  data = props.data;
135
315
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
136
- var count = reactRedux.useSelector(function (state) {
137
- return state.counter.value;
138
- });
139
316
  return /*#__PURE__*/React__default.createElement("div", {
140
317
  className: "relative w-full bg-cover bg-center bg-no-repeat ",
141
318
  style: {
@@ -1574,12 +1751,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1574
1751
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1575
1752
 
1576
1753
  var utils$1 = {
1577
- __proto__: null,
1578
- hasBrowserEnv: hasBrowserEnv,
1579
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1580
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1581
- navigator: _navigator,
1582
- origin: origin
1754
+ __proto__: null,
1755
+ hasBrowserEnv: hasBrowserEnv,
1756
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1757
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1758
+ navigator: _navigator,
1759
+ origin: origin
1583
1760
  };
1584
1761
 
1585
1762
  var platform$1 = {
@@ -4718,8 +4895,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
4718
4895
  var _nodeResolve_empty = {};
4719
4896
 
4720
4897
  var _nodeResolve_empty$1 = {
4721
- __proto__: null,
4722
- 'default': _nodeResolve_empty
4898
+ __proto__: null,
4899
+ 'default': _nodeResolve_empty
4723
4900
  };
4724
4901
 
4725
4902
  var utilInspect = getCjsExportFromNamespace(_nodeResolve_empty$1);
@@ -6922,7 +7099,7 @@ var ProductImage = function ProductImage(props) {
6922
7099
  };
6923
7100
  return src ? /*#__PURE__*/React__default.createElement("img", {
6924
7101
  src: src,
6925
- className: className,
7102
+ className: "w-full aspect-square " + className,
6926
7103
  style: size ? {
6927
7104
  width: size,
6928
7105
  height: size
@@ -8448,6 +8625,7 @@ exports.Hero11 = Hero11;
8448
8625
  exports.Hero12 = Hero11$1;
8449
8626
  exports.Hero13 = Hero13;
8450
8627
  exports.Links1 = Links1;
8628
+ exports.NavBar7 = NavBar7;
8451
8629
  exports.Partner1 = Partner1;
8452
8630
  exports.Products1 = Products1;
8453
8631
  exports.Products10 = Products10;