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.
- package/dist/index.js +243 -63
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +245 -66
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -6
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,236 @@ 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
|
+
console.log("NavBar7 routes", routes);
|
|
100
|
+
console.log("NavBar7 userInfo", userInfo);
|
|
101
|
+
console.log("NavBar7 cartItems", cartItems);
|
|
102
|
+
var totalItem = cartItems.reduce(function (total, item) {
|
|
103
|
+
return total + item.quantity;
|
|
104
|
+
}, 0);
|
|
105
|
+
if (totalItem > 9) {
|
|
106
|
+
totalItem = "9+";
|
|
107
|
+
}
|
|
108
|
+
var cart = function cart() {
|
|
109
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
110
|
+
className: "flex"
|
|
111
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
112
|
+
className: "relative cursor-pointer"
|
|
113
|
+
}, /*#__PURE__*/React__default.createElement(io5.IoCartOutline, {
|
|
114
|
+
style: {
|
|
115
|
+
fontSize: "30px",
|
|
116
|
+
color: primary
|
|
117
|
+
}
|
|
118
|
+
}), totalItem ? /*#__PURE__*/React__default.createElement("small", {
|
|
119
|
+
className: "absolute aspect-square flex items-center bg-danger px-[2px] text-xs rounded-full",
|
|
120
|
+
style: {
|
|
121
|
+
color: textButton,
|
|
122
|
+
top: 0,
|
|
123
|
+
right: 0
|
|
124
|
+
}
|
|
125
|
+
}, totalItem) : null));
|
|
126
|
+
};
|
|
127
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
128
|
+
className: "w-full sticky top-0 shadow z-50",
|
|
129
|
+
style: {
|
|
130
|
+
background: background
|
|
131
|
+
}
|
|
132
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
133
|
+
className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20",
|
|
134
|
+
style: {
|
|
135
|
+
color: textBody
|
|
136
|
+
}
|
|
137
|
+
}, /*#__PURE__*/React__default.createElement("a", {
|
|
138
|
+
href: "/",
|
|
139
|
+
className: "flex items-center gap-2"
|
|
140
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
141
|
+
className: "object-cover w-12 h-12",
|
|
142
|
+
src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
|
|
143
|
+
alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
|
|
144
|
+
}), /*#__PURE__*/React__default.createElement("h3", {
|
|
145
|
+
className: "text-xl md:text-2xl whitespace-nowrap font-semibold",
|
|
146
|
+
style: {
|
|
147
|
+
color: primary
|
|
148
|
+
}
|
|
149
|
+
}, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
|
|
150
|
+
className: "hidden lg:flex flex-1 items-center gap-4"
|
|
151
|
+
}, routes === null || routes === void 0 ? void 0 : routes.map(function (route, index) {
|
|
152
|
+
return /*#__PURE__*/React__default.createElement("a", {
|
|
153
|
+
href: route === null || route === void 0 ? void 0 : route.route
|
|
154
|
+
}, (section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
|
|
155
|
+
className: "py-1 border-b",
|
|
156
|
+
style: {
|
|
157
|
+
color: textHeading,
|
|
158
|
+
borderColor: textHeading
|
|
159
|
+
}
|
|
160
|
+
}, route === null || route === void 0 ? void 0 : route.label) : /*#__PURE__*/React__default.createElement("div", {
|
|
161
|
+
className: "py-1"
|
|
162
|
+
}, route === null || route === void 0 ? void 0 : route.label));
|
|
163
|
+
})), cart(), !userInfo ?
|
|
164
|
+
/*#__PURE__*/
|
|
165
|
+
React__default.createElement("div", {
|
|
166
|
+
className: "flex justify-center"
|
|
167
|
+
}, /*#__PURE__*/React__default.createElement(fa.FaUserCircle, {
|
|
168
|
+
color: "#fff",
|
|
169
|
+
size: 48
|
|
170
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
171
|
+
className: "flex flex-col ml-2"
|
|
172
|
+
}, /*#__PURE__*/React__default.createElement("label", null, "Xin ch\xE0o!"), /*#__PURE__*/React__default.createElement("label", {
|
|
173
|
+
className: "font-semibold"
|
|
174
|
+
}, userInfo === null || userInfo === void 0 ? void 0 : userInfo.name, "Nguyen Thanh Tung"))) :
|
|
175
|
+
/*#__PURE__*/
|
|
176
|
+
React__default.createElement("div", {
|
|
177
|
+
className: "flex gap-2"
|
|
178
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
179
|
+
label: "Đăng nhập",
|
|
180
|
+
shopConfigStyle: shopConfigStyle,
|
|
181
|
+
onClick: function onClick() {
|
|
182
|
+
return navToLogin();
|
|
183
|
+
}
|
|
184
|
+
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
185
|
+
label: "Đăng ký",
|
|
186
|
+
shopConfigStyle: shopConfigStyle,
|
|
187
|
+
style: {
|
|
188
|
+
backgroundColor: "transparent",
|
|
189
|
+
borderColor: primary,
|
|
190
|
+
color: primary
|
|
191
|
+
},
|
|
192
|
+
className: "border",
|
|
193
|
+
onClick: function onClick() {
|
|
194
|
+
return navToRegister();
|
|
195
|
+
}
|
|
196
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
197
|
+
className: "relative lg:hidden flex gap-4 items-center px-4 py-2"
|
|
198
|
+
}, /*#__PURE__*/React__default.createElement("a", {
|
|
199
|
+
href: "/",
|
|
200
|
+
className: "flex flex-1 gap-2 items-center"
|
|
201
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
202
|
+
className: "object-cover w-12 h-12",
|
|
203
|
+
src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
|
|
204
|
+
alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
|
|
205
|
+
}), /*#__PURE__*/React__default.createElement("h3", {
|
|
206
|
+
className: "text-xl md:text-2xl font-semibold",
|
|
207
|
+
style: {
|
|
208
|
+
color: primary
|
|
209
|
+
}
|
|
210
|
+
}, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
onClick: function onClick() {
|
|
213
|
+
setIsOpen(true);
|
|
214
|
+
}
|
|
215
|
+
}, /*#__PURE__*/React__default.createElement(fi.FiMenu, {
|
|
216
|
+
size: 32,
|
|
217
|
+
color: primary
|
|
218
|
+
})), isOpen ? /*#__PURE__*/React__default.createElement("div", {
|
|
219
|
+
className: "absolute bg-[rgba(0,0,0,0.5)] h-screen w-full top-0 left-0 z-50 flex justify-end",
|
|
220
|
+
onClick: function onClick() {
|
|
221
|
+
setIsOpen(false);
|
|
222
|
+
}
|
|
223
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
224
|
+
className: "h-full w-[80vw] max-w-[320px] p-4",
|
|
225
|
+
style: {
|
|
226
|
+
background: bgSecondary
|
|
227
|
+
},
|
|
228
|
+
onClick: function onClick(event) {
|
|
229
|
+
return event.stopPropagation();
|
|
230
|
+
}
|
|
231
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
232
|
+
className: "flex w-full justify-end text-gray4",
|
|
233
|
+
onClick: function onClick() {
|
|
234
|
+
setIsOpen(false);
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/React__default.createElement(rx.RxCross2, {
|
|
237
|
+
size: 24
|
|
238
|
+
})), /*#__PURE__*/React__default.createElement("div", null, routes === null || routes === void 0 ? void 0 : routes.map(function (route, index) {
|
|
239
|
+
return /*#__PURE__*/React__default.createElement("a", {
|
|
240
|
+
href: route === null || route === void 0 ? void 0 : route.route
|
|
241
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
242
|
+
className: "py-2",
|
|
243
|
+
style: (section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? {
|
|
244
|
+
color: textHeading
|
|
245
|
+
} : null
|
|
246
|
+
}, route === null || route === void 0 ? void 0 : route.label));
|
|
247
|
+
})))) : null, cart()));
|
|
248
|
+
};
|
|
249
|
+
|
|
21
250
|
var SvgIcon = function SvgIcon(_ref) {
|
|
22
251
|
var className = _ref.className,
|
|
23
252
|
style = _ref.style;
|
|
@@ -82,61 +311,11 @@ var SectionTitle1 = function SectionTitle1(props) {
|
|
|
82
311
|
}, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
|
|
83
312
|
};
|
|
84
313
|
|
|
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
314
|
var Hero10 = function Hero10(props) {
|
|
132
315
|
var _data$data, _data$data$, _data$data$$srcImages, _sectionData$, _sectionData$2, _sectionData$2$button;
|
|
133
316
|
var shopConfigStyle = props.shopConfigStyle,
|
|
134
317
|
data = props.data;
|
|
135
318
|
var sectionData = data === null || data === void 0 ? void 0 : data.data;
|
|
136
|
-
var count = reactRedux.useSelector(function (state) {
|
|
137
|
-
var _state$counter;
|
|
138
|
-
return state === null || state === void 0 ? void 0 : (_state$counter = state.counter) === null || _state$counter === void 0 ? void 0 : _state$counter.value;
|
|
139
|
-
});
|
|
140
319
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
141
320
|
className: "relative w-full bg-cover bg-center bg-no-repeat ",
|
|
142
321
|
style: {
|
|
@@ -1575,12 +1754,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
1575
1754
|
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
1576
1755
|
|
|
1577
1756
|
var utils$1 = {
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1757
|
+
__proto__: null,
|
|
1758
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
1759
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1760
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
1761
|
+
navigator: _navigator,
|
|
1762
|
+
origin: origin
|
|
1584
1763
|
};
|
|
1585
1764
|
|
|
1586
1765
|
var platform$1 = {
|
|
@@ -4719,8 +4898,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
|
4719
4898
|
var _nodeResolve_empty = {};
|
|
4720
4899
|
|
|
4721
4900
|
var _nodeResolve_empty$1 = {
|
|
4722
|
-
|
|
4723
|
-
|
|
4901
|
+
__proto__: null,
|
|
4902
|
+
'default': _nodeResolve_empty
|
|
4724
4903
|
};
|
|
4725
4904
|
|
|
4726
4905
|
var utilInspect = getCjsExportFromNamespace(_nodeResolve_empty$1);
|
|
@@ -6923,7 +7102,7 @@ var ProductImage = function ProductImage(props) {
|
|
|
6923
7102
|
};
|
|
6924
7103
|
return src ? /*#__PURE__*/React__default.createElement("img", {
|
|
6925
7104
|
src: src,
|
|
6926
|
-
className: className,
|
|
7105
|
+
className: "w-full aspect-square " + className,
|
|
6927
7106
|
style: size ? {
|
|
6928
7107
|
width: size,
|
|
6929
7108
|
height: size
|
|
@@ -8449,6 +8628,7 @@ exports.Hero11 = Hero11;
|
|
|
8449
8628
|
exports.Hero12 = Hero11$1;
|
|
8450
8629
|
exports.Hero13 = Hero13;
|
|
8451
8630
|
exports.Links1 = Links1;
|
|
8631
|
+
exports.NavBar7 = NavBar7;
|
|
8452
8632
|
exports.Partner1 = Partner1;
|
|
8453
8633
|
exports.Products1 = Products1;
|
|
8454
8634
|
exports.Products10 = Products10;
|