contentoh-components-library 21.2.13 → 21.2.14
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/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
- package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
- package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
- package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
- package/dist/components/atoms/MenuCommercialRetailers/styles.js +20 -0
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
- package/dist/components/atoms/MenuProductImage/index.js +88 -0
- package/dist/components/atoms/MenuProductImage/styles.js +20 -0
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
- package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
- package/dist/components/molecules/ApproveRejetPanel/styles.js +18 -0
- package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +28 -0
- package/dist/components/molecules/SignInLoginCreationApp/index.js +270 -0
- package/dist/components/molecules/SignInLoginCreationApp/styles.js +20 -0
- package/dist/components/pages/ProviderProductEdition/index.js +13 -9
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +44 -48
- package/dist/components/pages/RetailerProductEdition/index.js +1 -1
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/index.js +1 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +47 -51
- package/src/components/pages/RetailerProductEdition/index.js +1 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SignInLoginCreationApp = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _index = require("../../atoms/LogoImage/index");
|
|
19
|
+
|
|
20
|
+
var _index2 = require("../../atoms/ScreenHeader/index");
|
|
21
|
+
|
|
22
|
+
var _index3 = require("../../atoms/GeneralButton/index");
|
|
23
|
+
|
|
24
|
+
var _index4 = require("../../atoms/CheckBox/index");
|
|
25
|
+
|
|
26
|
+
var _TagAndInput = require("../TagAndInput");
|
|
27
|
+
|
|
28
|
+
var _variables = require("../../../global-files/variables");
|
|
29
|
+
|
|
30
|
+
var _react = require("react");
|
|
31
|
+
|
|
32
|
+
var _Loading = require("../../atoms/Loading");
|
|
33
|
+
|
|
34
|
+
var _reactRouterDom = require("react-router-dom");
|
|
35
|
+
|
|
36
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
37
|
+
|
|
38
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
|
+
|
|
40
|
+
var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
41
|
+
var _useState = (0, _react.useState)(false),
|
|
42
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
43
|
+
emptyEmail = _useState2[0],
|
|
44
|
+
setEmptyEmail = _useState2[1];
|
|
45
|
+
|
|
46
|
+
var _useState3 = (0, _react.useState)(false),
|
|
47
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
48
|
+
invalidEmail = _useState4[0],
|
|
49
|
+
setInvalidEmail = _useState4[1];
|
|
50
|
+
|
|
51
|
+
var _useState5 = (0, _react.useState)(false),
|
|
52
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
53
|
+
emptyPassword = _useState6[0],
|
|
54
|
+
setEmptyPassword = _useState6[1];
|
|
55
|
+
|
|
56
|
+
var _useState7 = (0, _react.useState)(true),
|
|
57
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
58
|
+
showErrors = _useState8[0],
|
|
59
|
+
setShowErrors = _useState8[1];
|
|
60
|
+
|
|
61
|
+
var _useState9 = (0, _react.useState)(""),
|
|
62
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
63
|
+
signInError = _useState10[0],
|
|
64
|
+
setSignInError = _useState10[1];
|
|
65
|
+
|
|
66
|
+
var _useState11 = (0, _react.useState)(false),
|
|
67
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
68
|
+
loading = _useState12[0],
|
|
69
|
+
setLoading = _useState12[1];
|
|
70
|
+
|
|
71
|
+
var _useState13 = (0, _react.useState)(false),
|
|
72
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
73
|
+
upgradePlanRedirect = _useState14[0],
|
|
74
|
+
setUpgradePlanRedirect = _useState14[1];
|
|
75
|
+
|
|
76
|
+
var validate = /*#__PURE__*/function () {
|
|
77
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
78
|
+
var valid, email, password, session, userGroup, response, userGroupValue, user, company;
|
|
79
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
80
|
+
while (1) {
|
|
81
|
+
switch (_context.prev = _context.next) {
|
|
82
|
+
case 0:
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
setSignInError("");
|
|
85
|
+
setShowErrors(true);
|
|
86
|
+
valid = true;
|
|
87
|
+
email = document.querySelector("#emailInput").value.trim();
|
|
88
|
+
password = document.querySelector("#passwordInput").value;
|
|
89
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
90
|
+
|
|
91
|
+
if (email === "") {
|
|
92
|
+
valid = false;
|
|
93
|
+
setEmptyEmail(true);
|
|
94
|
+
} else {
|
|
95
|
+
setEmptyEmail(false);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (password === "") {
|
|
99
|
+
valid = false;
|
|
100
|
+
setEmptyPassword(true);
|
|
101
|
+
} else {
|
|
102
|
+
setEmptyPassword(false);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!valid) {
|
|
106
|
+
_context.next = 35;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_context.prev = 10;
|
|
111
|
+
setLoading(true);
|
|
112
|
+
_context.next = 14;
|
|
113
|
+
return props.Auth.signIn(email, password);
|
|
114
|
+
|
|
115
|
+
case 14:
|
|
116
|
+
session = _context.sent;
|
|
117
|
+
|
|
118
|
+
if (!(session.challengeName === "NEW_PASSWORD_REQUIRED")) {
|
|
119
|
+
_context.next = 20;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
props.setUser(session);
|
|
124
|
+
props.setPaso(8);
|
|
125
|
+
_context.next = 28;
|
|
126
|
+
break;
|
|
127
|
+
|
|
128
|
+
case 20:
|
|
129
|
+
userGroup = session.signInUserSession.accessToken.payload["cognito:groups"];
|
|
130
|
+
_context.next = 23;
|
|
131
|
+
return _axios.default.get(process.env.REACT_APP_USER_ENDPOINT, {
|
|
132
|
+
headers: {
|
|
133
|
+
Authorization: session.signInUserSession.idToken.jwtToken
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
case 23:
|
|
138
|
+
response = _context.sent;
|
|
139
|
+
console.log(userGroup);
|
|
140
|
+
console.log(userGroup[0]);
|
|
141
|
+
userGroupValue = typeof userGroup === "string" ? userGroup : userGroup[0];
|
|
142
|
+
|
|
143
|
+
if (userGroupValue === "colaboradores_contentoh") {
|
|
144
|
+
sessionStorage.setItem("auth", true);
|
|
145
|
+
sessionStorage.setItem("jwt", session.signInUserSession.idToken.jwtToken);
|
|
146
|
+
user = JSON.parse(response.data.body).data[0];
|
|
147
|
+
company = JSON.parse(response.data.body).data[1];
|
|
148
|
+
caches.keys().then(function (names) {
|
|
149
|
+
names.forEach(function (name) {
|
|
150
|
+
caches.delete(name);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
user.src = "https://".concat(process.env.REACT_APP_IMAGES_PROFILE_BUCKET, ".s3.amazonaws.com/id-").concat(user.id_user, "/").concat(user.id_user, ".png?").concat(new Date().getTime());
|
|
154
|
+
sessionStorage.setItem("user", JSON.stringify(user));
|
|
155
|
+
sessionStorage.setItem("company", JSON.stringify(company));
|
|
156
|
+
setUpgradePlanRedirect(true);
|
|
157
|
+
} else {
|
|
158
|
+
setSignInError("NotAuthorizedException");
|
|
159
|
+
setLoading(false);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
case 28:
|
|
163
|
+
_context.next = 35;
|
|
164
|
+
break;
|
|
165
|
+
|
|
166
|
+
case 30:
|
|
167
|
+
_context.prev = 30;
|
|
168
|
+
_context.t0 = _context["catch"](10);
|
|
169
|
+
console.log(_context.t0);
|
|
170
|
+
setLoading(false);
|
|
171
|
+
|
|
172
|
+
if (_context.t0.code === "NotAuthorizedException") {
|
|
173
|
+
setSignInError("NotAuthorizedException");
|
|
174
|
+
} else if (_context.t0.code === "UserNotConfirmedException") {
|
|
175
|
+
sessionStorage.setItem("email", JSON.stringify(document.querySelector("#usernameInput").value));
|
|
176
|
+
props.setPaso(5);
|
|
177
|
+
} else {
|
|
178
|
+
setSignInError("Error");
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
case 35:
|
|
182
|
+
case "end":
|
|
183
|
+
return _context.stop();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}, _callee, null, [[10, 30]]);
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
return function validate(_x) {
|
|
190
|
+
return _ref.apply(this, arguments);
|
|
191
|
+
};
|
|
192
|
+
}();
|
|
193
|
+
|
|
194
|
+
(0, _react.useEffect)(function () {
|
|
195
|
+
sessionStorage.getItem("resetPasswordProcess") && sessionStorage.removeItem("resetPasswordProcess");
|
|
196
|
+
}, []);
|
|
197
|
+
(0, _react.useEffect)(function () {
|
|
198
|
+
if (upgradePlanRedirect) setLoading(false);
|
|
199
|
+
}, [upgradePlanRedirect]);
|
|
200
|
+
return loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
201
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
202
|
+
className: "home-login",
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
204
|
+
className: "main-container",
|
|
205
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LogoImage, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
206
|
+
className: "credenciales",
|
|
207
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.ScreenHeader, {
|
|
208
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
209
|
+
color: _variables.GlobalColors.s5,
|
|
210
|
+
text: "Ingresa tus credenciales"
|
|
211
|
+
})
|
|
212
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
213
|
+
className: "user",
|
|
214
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
215
|
+
inputType: "text",
|
|
216
|
+
label: "Nombre de usuario",
|
|
217
|
+
inputPlaceHolder: "username@contentoh.com",
|
|
218
|
+
inputId: "emailInput"
|
|
219
|
+
})
|
|
220
|
+
}), showErrors && emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
221
|
+
children: "Ingrese su correo"
|
|
222
|
+
}), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
223
|
+
children: "Ingrese un correo v\xE1lido"
|
|
224
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
225
|
+
className: "password",
|
|
226
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
227
|
+
inputType: "password",
|
|
228
|
+
label: "Contraseña",
|
|
229
|
+
inputPlaceHolder: "Escribe tu contraseña",
|
|
230
|
+
inputId: "passwordInput"
|
|
231
|
+
})
|
|
232
|
+
}), showErrors && emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
233
|
+
children: "Ingrese su contrase\xF1a"
|
|
234
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
235
|
+
className: "select",
|
|
236
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.CheckBox, {
|
|
237
|
+
label: "Mantener sesión activada",
|
|
238
|
+
id: "chk-default",
|
|
239
|
+
className: "active-left"
|
|
240
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
241
|
+
onClick: function onClick() {
|
|
242
|
+
return props.setPaso(10);
|
|
243
|
+
},
|
|
244
|
+
className: "active-right",
|
|
245
|
+
children: "Olvide mi contrase\xF1a"
|
|
246
|
+
})]
|
|
247
|
+
}), showErrors && signInError === "NotAuthorizedException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
248
|
+
children: "Correo o contrase\xF1a incorrectos"
|
|
249
|
+
}), showErrors && signInError === "Error" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
250
|
+
children: "Ha habido un problema al iniciar sesi\xF3n"
|
|
251
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
252
|
+
className: "button-right",
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Button, {
|
|
254
|
+
buttonType: "general-default-button",
|
|
255
|
+
label: "Iniciar sesión",
|
|
256
|
+
onClick: function onClick(e) {
|
|
257
|
+
return validate(e);
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
})]
|
|
261
|
+
})
|
|
262
|
+
}), upgradePlanRedirect && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Redirect, {
|
|
263
|
+
to: {
|
|
264
|
+
pathname: "/dashboard"
|
|
265
|
+
}
|
|
266
|
+
})]
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
exports.SignInLoginCreationApp = SignInLoginCreationApp;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: \"white\";\n display: flex;\n height: 100vh;\n width: 50%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 20px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n cursor: pointer;\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -1545,6 +1545,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1545
1545
|
|
|
1546
1546
|
case 8:
|
|
1547
1547
|
evalResponse = _context13.sent;
|
|
1548
|
+
console.log(evalResponse.map(function (_ref15) {
|
|
1549
|
+
var data = _ref15.data;
|
|
1550
|
+
return JSON.parse(data.body);
|
|
1551
|
+
}));
|
|
1548
1552
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1549
1553
|
productTemp = product;
|
|
1550
1554
|
productTemp.article_status = "".concat(result).concat(userType);
|
|
@@ -1573,24 +1577,24 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1573
1577
|
idCategory: productTemp.article.id_category,
|
|
1574
1578
|
product: productTemp
|
|
1575
1579
|
}));
|
|
1576
|
-
_context13.next =
|
|
1580
|
+
_context13.next = 26;
|
|
1577
1581
|
return loadData();
|
|
1578
1582
|
|
|
1579
|
-
case
|
|
1580
|
-
_context13.next =
|
|
1583
|
+
case 26:
|
|
1584
|
+
_context13.next = 31;
|
|
1581
1585
|
break;
|
|
1582
1586
|
|
|
1583
|
-
case
|
|
1584
|
-
_context13.prev =
|
|
1587
|
+
case 28:
|
|
1588
|
+
_context13.prev = 28;
|
|
1585
1589
|
_context13.t0 = _context13["catch"](0);
|
|
1586
1590
|
console.log(_context13.t0);
|
|
1587
1591
|
|
|
1588
|
-
case
|
|
1592
|
+
case 31:
|
|
1589
1593
|
case "end":
|
|
1590
1594
|
return _context13.stop();
|
|
1591
1595
|
}
|
|
1592
1596
|
}
|
|
1593
|
-
}, _callee13, null, [[0,
|
|
1597
|
+
}, _callee13, null, [[0, 28]]);
|
|
1594
1598
|
}));
|
|
1595
1599
|
|
|
1596
1600
|
return function validateAll(_x8) {
|
|
@@ -1599,7 +1603,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1599
1603
|
}();
|
|
1600
1604
|
|
|
1601
1605
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1602
|
-
var
|
|
1606
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
|
|
1603
1607
|
var data, prod, statusComplete;
|
|
1604
1608
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
1605
1609
|
while (1) {
|
|
@@ -1641,7 +1645,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1641
1645
|
}));
|
|
1642
1646
|
|
|
1643
1647
|
return function evaluationToRetailer(_x9) {
|
|
1644
|
-
return
|
|
1648
|
+
return _ref16.apply(this, arguments);
|
|
1645
1649
|
};
|
|
1646
1650
|
}();
|
|
1647
1651
|
|
package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.RegistrationLoginFirstStepDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _loginImage = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/loginImage.svg"));
|
|
15
|
+
|
|
16
|
+
var _login = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login2.svg"));
|
|
17
|
+
|
|
18
|
+
var _login2 = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login3.svg"));
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var _default = {
|
|
23
|
+
title: "Components/pages/RegistrationLoginFirstStep",
|
|
24
|
+
component: _index.RegistrationLoginFirstStep
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
27
|
+
|
|
28
|
+
var Template = function Template(args) {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.RegistrationLoginFirstStep, (0, _objectSpread2.default)({}, args));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var RegistrationLoginFirstStepDefault = Template.bind({});
|
|
33
|
+
exports.RegistrationLoginFirstStepDefault = RegistrationLoginFirstStepDefault;
|
|
34
|
+
RegistrationLoginFirstStepDefault.args = {
|
|
35
|
+
imageArrayCarousel: [_loginImage.default, _login.default, _login2.default],
|
|
36
|
+
textCarousel: "Elige la plataforma que conecta proovedores y retailers"
|
|
37
|
+
};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RegistrationLoginFirstStep = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _GradientPanel = require("../../atoms/GradientPanel");
|
|
19
|
+
|
|
20
|
+
var _CarouselImagesLogin = require("../../molecules/CarouselImagesLogin");
|
|
21
|
+
|
|
22
|
+
var _react = require("react");
|
|
23
|
+
|
|
24
|
+
var _LogoImage = require("../../atoms/LogoImage");
|
|
25
|
+
|
|
26
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
27
|
+
|
|
28
|
+
var _variables = require("../../../global-files/variables");
|
|
29
|
+
|
|
30
|
+
var _TagAndInput = require("../../molecules/TagAndInput");
|
|
31
|
+
|
|
32
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
33
|
+
|
|
34
|
+
var _GeneralInput = require("../../atoms/GeneralInput");
|
|
35
|
+
|
|
36
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
|
+
|
|
38
|
+
var RegistrationLoginFirstStep = function RegistrationLoginFirstStep(_ref) {
|
|
39
|
+
var _ref$imageArrayCarous = _ref.imageArrayCarousel,
|
|
40
|
+
imageArrayCarousel = _ref$imageArrayCarous === void 0 ? [] : _ref$imageArrayCarous,
|
|
41
|
+
textCarousel = _ref.textCarousel,
|
|
42
|
+
backogroundColorCarousel = _ref.backogroundColorCarousel;
|
|
43
|
+
|
|
44
|
+
var _useState = (0, _react.useState)(false),
|
|
45
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
46
|
+
emptyName = _useState2[0],
|
|
47
|
+
setEmptyName = _useState2[1];
|
|
48
|
+
|
|
49
|
+
var _useState3 = (0, _react.useState)(false),
|
|
50
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
51
|
+
emptyLastName = _useState4[0],
|
|
52
|
+
setEmptyLastName = _useState4[1];
|
|
53
|
+
|
|
54
|
+
var _useState5 = (0, _react.useState)(false),
|
|
55
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
56
|
+
emptyEmail = _useState6[0],
|
|
57
|
+
setEmptyEmail = _useState6[1];
|
|
58
|
+
|
|
59
|
+
var _useState7 = (0, _react.useState)(false),
|
|
60
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
61
|
+
emptyJob = _useState8[0],
|
|
62
|
+
setEmptyJob = _useState8[1];
|
|
63
|
+
|
|
64
|
+
var _useState9 = (0, _react.useState)(false),
|
|
65
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
66
|
+
emptyPhone = _useState10[0],
|
|
67
|
+
setEmptyPhone = _useState10[1];
|
|
68
|
+
|
|
69
|
+
var _useState11 = (0, _react.useState)(false),
|
|
70
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
71
|
+
invalidEmail = _useState12[0],
|
|
72
|
+
setInvalidEmail = _useState12[1];
|
|
73
|
+
|
|
74
|
+
var validate = /*#__PURE__*/function () {
|
|
75
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
76
|
+
var name, lastName, email, job, phone;
|
|
77
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
78
|
+
while (1) {
|
|
79
|
+
switch (_context.prev = _context.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
name = document.querySelector("#nameInput").value;
|
|
83
|
+
lastName = document.querySelector("#lastNameInput").value;
|
|
84
|
+
email = document.querySelector("#emailInput").value;
|
|
85
|
+
job = document.querySelector("#jobInput").value;
|
|
86
|
+
phone = document.querySelector("#phoneInput").value;
|
|
87
|
+
name === "" ? setEmptyName(true) : setEmptyName(false);
|
|
88
|
+
lastName === "" ? setEmptyLastName(true) : setEmptyLastName(false);
|
|
89
|
+
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
90
|
+
job === "" ? setEmptyJob(true) : setEmptyJob(false);
|
|
91
|
+
phone === "" ? setEmptyPhone(true) : setEmptyPhone(false);
|
|
92
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
93
|
+
|
|
94
|
+
case 12:
|
|
95
|
+
case "end":
|
|
96
|
+
return _context.stop();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, _callee);
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
return function validate(_x) {
|
|
103
|
+
return _ref2.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
}();
|
|
106
|
+
|
|
107
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
|
+
className: "credenciales",
|
|
109
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
110
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
111
|
+
color: _variables.GlobalColors.s5,
|
|
112
|
+
text: "Ingresa tus credenciales"
|
|
113
|
+
})
|
|
114
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
115
|
+
className: "user",
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
117
|
+
className: "name-registration-user",
|
|
118
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
119
|
+
inputType: "text",
|
|
120
|
+
inputId: "nameInput",
|
|
121
|
+
label: "Nombre",
|
|
122
|
+
inputPlaceHolder: "Nombre"
|
|
123
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
124
|
+
inputType: "text",
|
|
125
|
+
inputId: "lastNameInput",
|
|
126
|
+
label: "Apellido",
|
|
127
|
+
inputPlaceHolder: "Apellido"
|
|
128
|
+
})]
|
|
129
|
+
}), emptyName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
130
|
+
children: "Ingrese su nombre"
|
|
131
|
+
}), emptyLastName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
132
|
+
children: "Ingrese sus apellidos"
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
134
|
+
inputType: "text",
|
|
135
|
+
inputId: "emailInput",
|
|
136
|
+
label: "Correo electrónico",
|
|
137
|
+
inputPlaceHolder: "username@contentoh.com"
|
|
138
|
+
}), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
139
|
+
children: "Ingrese su correo"
|
|
140
|
+
}), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
141
|
+
children: "Ingrese un correo v\xE1lido"
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
143
|
+
inputType: "text",
|
|
144
|
+
inputId: "jobInput",
|
|
145
|
+
label: "Puesto laboral",
|
|
146
|
+
inputPlaceHolder: "Puesto dentro de la empresa"
|
|
147
|
+
}), emptyJob && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
148
|
+
children: "Ingrese su puesto"
|
|
149
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
150
|
+
text: "Teléfono",
|
|
151
|
+
headerType: "input-name-header"
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
153
|
+
className: "phone-registration-user",
|
|
154
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
155
|
+
name: "select",
|
|
156
|
+
className: "phone-options",
|
|
157
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
158
|
+
children: "+52"
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
160
|
+
children: "+54"
|
|
161
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
162
|
+
children: "+57"
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
164
|
+
children: "+506"
|
|
165
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
166
|
+
children: "+593"
|
|
167
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
168
|
+
children: "+503"
|
|
169
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
170
|
+
children: "+504"
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
172
|
+
children: "+507"
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
174
|
+
children: "+51"
|
|
175
|
+
})]
|
|
176
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
|
|
177
|
+
inputId: "phoneInput",
|
|
178
|
+
inputType: "text",
|
|
179
|
+
inputPlaceholder: "Teléfono"
|
|
180
|
+
})]
|
|
181
|
+
}), emptyPhone && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
182
|
+
children: "Ingrese su n\xFAmero de tel\xE9fono"
|
|
183
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
184
|
+
text: "País",
|
|
185
|
+
headerType: "input-name-header"
|
|
186
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
187
|
+
name: "select",
|
|
188
|
+
className: "country-options",
|
|
189
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
190
|
+
value: "value1",
|
|
191
|
+
selected: true,
|
|
192
|
+
children: "Selecciona tu pa\xEDs"
|
|
193
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
194
|
+
value: "value2",
|
|
195
|
+
children: "Argentina"
|
|
196
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
197
|
+
value: "value3",
|
|
198
|
+
children: "Colombia"
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
200
|
+
value: "value2",
|
|
201
|
+
children: "Ecuador"
|
|
202
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
203
|
+
value: "value3",
|
|
204
|
+
children: "El Salvador"
|
|
205
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
206
|
+
value: "value2",
|
|
207
|
+
children: "Honduras"
|
|
208
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
209
|
+
value: "value3",
|
|
210
|
+
children: "M\xE9xico"
|
|
211
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
212
|
+
value: "value2",
|
|
213
|
+
children: "Panam\xE1"
|
|
214
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
215
|
+
value: "value3",
|
|
216
|
+
children: "Per\xFA"
|
|
217
|
+
})]
|
|
218
|
+
}), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
219
|
+
children: "Seleccione su pa\xEDs"
|
|
220
|
+
})]
|
|
221
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
222
|
+
className: "button-end",
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
224
|
+
buttonType: "general-default-button",
|
|
225
|
+
label: "Enviar",
|
|
226
|
+
onClick: function onClick(e) {
|
|
227
|
+
return validate(e);
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
231
|
+
className: "progress-bar",
|
|
232
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
233
|
+
className: "progress-bar-first-step"
|
|
234
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
235
|
+
className: "progress-bar-registration"
|
|
236
|
+
})]
|
|
237
|
+
}, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
238
|
+
text: "Paso 1",
|
|
239
|
+
headerType: "date-header",
|
|
240
|
+
color: _variables.GlobalColors.s4
|
|
241
|
+
}, "6"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
242
|
+
className: "new-login",
|
|
243
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
244
|
+
className: "pre-registro",
|
|
245
|
+
children: ["\xBFYa tienes una cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
246
|
+
children: " Inicia Sesi\xF3n"
|
|
247
|
+
})]
|
|
248
|
+
})
|
|
249
|
+
}, "7")];
|
|
250
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
251
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
252
|
+
className: "home-retailer",
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselImagesLogin.CarouselImagesLogin, {
|
|
254
|
+
panelImg: imageArrayCarousel,
|
|
255
|
+
panelText: textCarousel,
|
|
256
|
+
panelColor: backogroundColorCarousel
|
|
257
|
+
})
|
|
258
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
259
|
+
className: "home-login-retailer",
|
|
260
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
261
|
+
componentsArray: loginRight,
|
|
262
|
+
panelType: "home-login",
|
|
263
|
+
panelColor: _variables.GlobalColors.white
|
|
264
|
+
})
|
|
265
|
+
})]
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
exports.RegistrationLoginFirstStep = RegistrationLoginFirstStep;
|