contentoh-components-library 21.0.26 → 21.0.27

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.
Files changed (51) hide show
  1. package/dist/components/atoms/Loading/Loading.stories.js +28 -0
  2. package/dist/components/atoms/Loading/index.js +27 -0
  3. package/dist/components/atoms/Loading/styles.js +18 -0
  4. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
  5. package/dist/components/molecules/EmailResetPasswordLogin/index.js +159 -0
  6. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
  7. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
  8. package/dist/components/molecules/RegistrationFirstStep/index.js +371 -0
  9. package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
  10. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
  11. package/dist/components/molecules/RegistrationSecondStep/index.js +156 -0
  12. package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
  13. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
  14. package/dist/components/molecules/RegistrationThirdStep/index.js +161 -0
  15. package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
  16. package/dist/components/molecules/SignInLogin/index.js +213 -67
  17. package/dist/components/molecules/SignInLogin/styles.js +1 -1
  18. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
  19. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +104 -0
  20. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
  21. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
  22. package/dist/components/organisms/ChangePassword/ChangePassword.stories.js +28 -0
  23. package/dist/components/organisms/ChangePassword/index.js +113 -0
  24. package/dist/components/organisms/ChangePassword/styles.js +18 -0
  25. package/dist/index.js +138 -47
  26. package/package.json +4 -2
  27. package/src/components/atoms/Loading/Loading.stories.js +10 -0
  28. package/src/components/atoms/Loading/index.js +13 -0
  29. package/src/components/atoms/Loading/styles.js +57 -0
  30. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
  31. package/src/components/molecules/EmailResetPasswordLogin/index.js +87 -0
  32. package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
  33. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
  34. package/src/components/molecules/RegistrationFirstStep/index.js +259 -0
  35. package/src/components/molecules/RegistrationFirstStep/styles.js +81 -0
  36. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
  37. package/src/components/molecules/RegistrationSecondStep/index.js +97 -0
  38. package/src/components/molecules/RegistrationSecondStep/styles.js +59 -0
  39. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
  40. package/src/components/molecules/RegistrationThirdStep/index.js +109 -0
  41. package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
  42. package/src/components/molecules/SignInLogin/index.js +177 -55
  43. package/src/components/molecules/SignInLogin/styles.js +1 -0
  44. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
  45. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +78 -0
  46. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +49 -0
  47. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +56 -0
  48. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
  49. package/src/components/organisms/ChangePassword/index.js +63 -0
  50. package/src/components/organisms/ChangePassword/styles.js +16 -0
  51. package/src/index.js +7 -0
@@ -0,0 +1,97 @@
1
+ import { Container } from "./styles";
2
+ import { GradientPanel } from "../../atoms/GradientPanel";
3
+ import { useState } from "react";
4
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
5
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
6
+ import { Button } from "../../atoms/GeneralButton";
7
+ import { LoginPasswordStrength } from "../../molecules/LoginPasswordStrength";
8
+ import { LogoImage } from "../../atoms/LogoImage";
9
+
10
+ export const RegistrationSecondStep = () => {
11
+ const [emptyPassword, setEmptyPassword] = useState(false);
12
+ const [emptyConfirmPassword, setEmptyConfirmPassword] = useState(false);
13
+ const [matchPasswords, setMatchPasswords] = useState(true);
14
+ const validate = async (e) => {
15
+ e.preventDefault();
16
+ const password = document.querySelector("#newPasswordInput").value;
17
+ password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
18
+ const confirmPassword = document.querySelector(
19
+ "#confirmPasswordInput"
20
+ ).value;
21
+ confirmPassword === ""
22
+ ? setEmptyConfirmPassword(true)
23
+ : setEmptyConfirmPassword(false);
24
+ if (password === confirmPassword) {
25
+ setMatchPasswords(true);
26
+ } else {
27
+ setMatchPasswords(false);
28
+ }
29
+ };
30
+ const loginRight = [
31
+ <LogoImage key="1" />,
32
+ <div className="credenciales" key={"2"}>
33
+ <ScreenHeader
34
+ fontFamily={FontFamily.AvenirNext}
35
+ color={GlobalColors.s5}
36
+ text={"Ingresa tus credenciales"}
37
+ />
38
+ </div>,
39
+ <LoginPasswordStrength
40
+ key={"3"}
41
+ emptyPassword={emptyPassword}
42
+ emptyConfirmPassword={emptyConfirmPassword}
43
+ matchPasswords={matchPasswords}
44
+ textTittle={"Ingresa tus credenciales"}
45
+ />,
46
+ <label className="label-terms" key={"4"}>Términos y condiciones</label>,
47
+ <div className="checkbox-terms" key={"5"}>
48
+ <input type="checkbox" />
49
+ <ScreenHeader
50
+ text={
51
+ "Conoce nuestros termnios y condiciones de cada uno de nuestros servicios. Si tienes algunda duda o comentario escríbenos."
52
+ }
53
+ headerType={"date-header"}
54
+ />
55
+ </div>,
56
+ <label className="label-terms" key={"6"}>Aviso de privacidad</label>,
57
+ <div className="checkbox-terms" key={"7"}>
58
+ <input type="checkbox" />
59
+ <ScreenHeader
60
+ text={"Todos los datos estan protegidos."}
61
+ headerType={"date-header"}
62
+ />
63
+ </div>,
64
+ <div className="button-end" key="8">
65
+ <Button
66
+ buttonType={"general-default-button"}
67
+ label={"Enviar"}
68
+ onClick={(e) => validate(e)}
69
+ />
70
+ </div>,
71
+ <div className="progress-bar" key={"9"}>
72
+ <div className="progress-bar-first-step-check"></div>
73
+ <div className="progress-bar-second-step"></div>
74
+ <div className="progress-bar-registration"></div>
75
+ </div>,
76
+ <ScreenHeader
77
+ text={"Paso 2"}
78
+ headerType={"date-header"}
79
+ color={GlobalColors.s4}
80
+ key={"10"}
81
+ />,
82
+ <div className="new-login" key="11">
83
+ <p className="pre-registro">
84
+ ¿Aún no tienes cuenta?<span> Regístrate</span>
85
+ </p>
86
+ </div>,
87
+ ];
88
+ return (
89
+ <Container>
90
+ <GradientPanel
91
+ panelColor={GlobalColors.white}
92
+ componentsArray={loginRight}
93
+ panelType={"home-login"}
94
+ ></GradientPanel>
95
+ </Container>
96
+ );
97
+ };
@@ -0,0 +1,59 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ display: flex;
6
+ width: 50%;
7
+ height: 100vh;
8
+ .button-end {
9
+ text-align: end;
10
+ .general-default-button {
11
+ width: 160px;
12
+ }
13
+ & + * {
14
+ margin-top: 10px;
15
+ }
16
+ }
17
+ .progress-bar {
18
+ width: 100%;
19
+ height: 8px;
20
+ display: flex;
21
+ justify-content: space-between;
22
+ .progress-bar-first-step-check {
23
+ width: 33.33%;
24
+ background-color: ${GlobalColors.exported};
25
+ }
26
+ .progress-bar-second-step {
27
+ width: 33.33%;
28
+ background-color: rgb(196, 196, 196);
29
+ }
30
+ .progress-bar-registration {
31
+ background-color: rgb(226, 226, 226);
32
+ width: 33.33%;
33
+ }
34
+ }
35
+ .date-header {
36
+ margin-left: 33.33%;
37
+ }
38
+ .checkbox-terms {
39
+ display: flex;
40
+ margin-bottom: 5px;
41
+ input {
42
+ cursor: pointer;
43
+ & + * {
44
+ margin-left: 15px;
45
+ }
46
+ }
47
+ }
48
+ .label-terms {
49
+ color: rgb(129, 115, 147);
50
+ font-size: 13px;
51
+ line-height: 24px;
52
+ font-weight: 700;
53
+ cursor: pointer;
54
+ margin-left: 25px;
55
+ & + * {
56
+ margin-top: 5px;
57
+ }
58
+ }
59
+ `;
@@ -0,0 +1,11 @@
1
+ import { RegistrationThirdStep } from "./index";
2
+
3
+ export default {
4
+ title: "Components/molecules/RegistrationThirdStep",
5
+ component: RegistrationThirdStep,
6
+ };
7
+ const Template = (args) => <RegistrationThirdStep {...args} />;
8
+
9
+ export const RegistrationThirdStepDefault = Template.bind({});
10
+
11
+ RegistrationThirdStepDefault.args = {};
@@ -0,0 +1,109 @@
1
+ import { Container } from "./styles";
2
+ import { GradientPanel } from "../../atoms/GradientPanel";
3
+ import { useState } from "react";
4
+ import { LogoImage } from "../../atoms/LogoImage";
5
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
6
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
7
+ import { TagAndInput } from "../../molecules/TagAndInput";
8
+ import { Button } from "../../atoms/GeneralButton";
9
+
10
+ export const RegistrationThirdStep = () => {
11
+ const [emptyCommercialName, setEmptyCommercialName] = useState(false);
12
+ const [emptyBussinesName, setEmptyBussinesName] = useState(false);
13
+ const [emptyRFC, setEmptyRFC] = useState(false);
14
+ const [emptyFiscalAddress, setEmptyFiscalAddress] = useState(false);
15
+ const validate = async (e) => {
16
+ e.preventDefault();
17
+ const commercialName = document.querySelector("#commercialNameInput").value;
18
+ const bussinesName = document.querySelector("#bussinesNameInput").value;
19
+ const RFC = document.querySelector("#rfcInput").value;
20
+ const FiscalAddress = document.querySelector("#fiscalAddressInput").value;
21
+ commercialName === ""
22
+ ? setEmptyCommercialName(true)
23
+ : setEmptyCommercialName(false);
24
+ bussinesName === ""
25
+ ? setEmptyBussinesName(true)
26
+ : setEmptyBussinesName(false);
27
+ RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
28
+ FiscalAddress === ""
29
+ ? setEmptyFiscalAddress(true)
30
+ : setEmptyFiscalAddress(false);
31
+ };
32
+ const loginRight = [
33
+ <LogoImage key="1" />,
34
+ <div className="credenciales" key={"2"}>
35
+ <ScreenHeader
36
+ fontFamily={FontFamily.AvenirNext}
37
+ color={GlobalColors.s5}
38
+ text={"Ingresa tus credenciales"}
39
+ />
40
+ </div>,
41
+ <div className="user" key="3">
42
+ <TagAndInput
43
+ inputType={"text"}
44
+ inputId={"commercialNameInput"}
45
+ label={"Nombre comercial"}
46
+ inputPlaceHolder={"Nombre comercial"}
47
+ />
48
+ {emptyCommercialName && (
49
+ <label>Ingrese el nombre comercial de la empresa</label>
50
+ )}
51
+ <TagAndInput
52
+ inputType={"text"}
53
+ inputId={"bussinesNameInput"}
54
+ label={"Razón social"}
55
+ inputPlaceHolder={"Razón social"}
56
+ />
57
+ {emptyBussinesName && (
58
+ <label>Ingrese la razón social de la empresa</label>
59
+ )}
60
+ <TagAndInput
61
+ inputType={"text"}
62
+ inputId={"rfcInput"}
63
+ label={"RFC"}
64
+ inputPlaceHolder={"RFC"}
65
+ />
66
+ {emptyRFC && <label>El RFC es requerido</label>}
67
+ <TagAndInput
68
+ inputType={"text"}
69
+ inputId={"fiscalAddressInput"}
70
+ label={"Direccion fiscal"}
71
+ inputPlaceHolder={"Dirección fiscal"}
72
+ />
73
+ {emptyFiscalAddress && (
74
+ <label>Ingrese la direccion fiscal de la empresa</label>
75
+ )}
76
+ </div>,
77
+ <div className="button-end" key="4">
78
+ <Button
79
+ buttonType={"general-default-button"}
80
+ label={"Enviar"}
81
+ onClick={(e) => validate(e)}
82
+ />
83
+ </div>,
84
+ <div className="progress-bar" key="5">
85
+ <div className="progress-bar-step-check"></div>
86
+ <div className="progress-bar-registration"></div>
87
+ </div>,
88
+ <ScreenHeader
89
+ text={"Paso 3"}
90
+ headerType={"date-header"}
91
+ color={GlobalColors.s4}
92
+ key="6"
93
+ />,
94
+ <div className="new-login" key="7">
95
+ <p className="pre-registro">
96
+ ¿Ya tienes una cuenta?<span> Inicia Sesión</span>
97
+ </p>
98
+ </div>,
99
+ ];
100
+ return (
101
+ <Container>
102
+ <GradientPanel
103
+ componentsArray={loginRight}
104
+ panelType={"home-login"}
105
+ panelColor={GlobalColors.white}
106
+ />
107
+ </Container>
108
+ );
109
+ };
@@ -0,0 +1,44 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ display: flex;
6
+ width: 50%;
7
+ height: 100%;
8
+ .user {
9
+ .input-name-header {
10
+ margin-top: 10px;
11
+ }
12
+ }
13
+ .button-end {
14
+ text-align: end;
15
+ .general-default-button {
16
+ width: 160px;
17
+ }
18
+ & + * {
19
+ margin-top: 10px;
20
+ }
21
+ }
22
+ .progress-bar {
23
+ width: 100%;
24
+ height: 8px;
25
+ display: flex;
26
+ justify-content: space-between;
27
+ .progress-bar-step-check {
28
+ width: 66.66%;
29
+ background-color: ${GlobalColors.exported};
30
+ }
31
+ .progress-bar-registration {
32
+ background-color: rgb(196, 196, 196);
33
+ width: 33.33%;
34
+ }
35
+ }
36
+ .date-header {
37
+ margin-left: 66.66%;
38
+ .new-login {
39
+ & + * {
40
+ margin-top: 20px;
41
+ }
42
+ }
43
+ }
44
+ `;
@@ -5,75 +5,197 @@ import { Button } from "../../atoms/GeneralButton/index";
5
5
  import { CheckBox } from "../../atoms/CheckBox/index";
6
6
  import { TagAndInput } from "../TagAndInput";
7
7
  import { FontFamily, GlobalColors } from "../../../global-files/variables";
8
- import { useState } from "react";
8
+ import { useState, useEffect } from "react";
9
+ import { Loading } from "../../atoms/Loading";
10
+ import { Redirect } from "react-router-dom";
9
11
 
10
- export const SignInLogin = () => {
12
+ export const SignInLogin = (props) => {
11
13
  const [emptyEmail, setEmptyEmail] = useState(false);
12
14
  const [invalidEmail, setInvalidEmail] = useState(false);
13
15
  const [emptyPassword, setEmptyPassword] = useState(false);
16
+ const [showErrors, setShowErrors] = useState(true);
17
+ const [signInError, setSignInError] = useState("");
18
+ const [loading, setLoading] = useState(false);
19
+ const [upgradePlanRedirect, setUpgradePlanRedirect] = useState(false);
14
20
  const validate = async (e) => {
21
+ setSignInError("");
22
+ setShowErrors(true);
15
23
  e.preventDefault();
24
+ let valid = true;
16
25
  const email = document.querySelector("#emailInput").value;
17
26
  const password = document.querySelector("#passwordInput").value;
18
- email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
19
- password === "" ? setEmptyPassword(true) : setEmptyPassword(false);
20
27
  !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
21
28
  email
22
29
  )
23
30
  ? setInvalidEmail(true)
24
31
  : setInvalidEmail(false);
32
+ if (email === "") {
33
+ valid = false;
34
+ setEmptyEmail(true);
35
+ } else {
36
+ setEmptyEmail(false);
37
+ }
38
+ if (password === "") {
39
+ valid = false;
40
+ setEmptyPassword(true);
41
+ } else {
42
+ setEmptyPassword(false);
43
+ }
44
+ if (valid) {
45
+ try {
46
+ setLoading(true);
47
+ const session = await Auth.signIn(email, password);
48
+ if (session.challengeName === "NEW_PASSWORD_REQUIRED") {
49
+ props.setUser(session);
50
+ props.setPaso(8);
51
+ } else {
52
+ const userGroup =
53
+ session.signInUserSession.accessToken.payload["cognito:groups"];
54
+ const response = await axios.get(
55
+ process.env.REACT_APP_USER_ENDPOINT,
56
+ {
57
+ headers: {
58
+ Authorization: session.signInUserSession.idToken.jwtToken,
59
+ },
60
+ }
61
+ );
62
+ const userGroupValue =
63
+ typeof userGroup === "string" ? userGroup : userGroup[0];
64
+ if (userGroupValue === "usuario_contentoh") {
65
+ sessionStorage.setItem("auth", true);
66
+ sessionStorage.setItem(
67
+ "jwt",
68
+ session.signInUserSession.idToken.jwtToken
69
+ );
70
+ const user = JSON.parse(response.data.body).data[0];
71
+ const company = JSON.parse(response.data.body).data[1];
72
+ caches.keys().then((names) => {
73
+ names.forEach((name) => {
74
+ caches.delete(name);
75
+ });
76
+ });
77
+ user.src = `https://${
78
+ process.env.REACT_APP_IMAGES_PROFILE_BUCKET
79
+ }.s3.amazonaws.com/id-${user.id_user}/${
80
+ user.id_user
81
+ }.png?${new Date().getTime()}`;
82
+ sessionStorage.setItem("user", JSON.stringify(user));
83
+ sessionStorage.setItem("company", JSON.stringify(company));
84
+ setUpgradePlanRedirect(true);
85
+ } else {
86
+ setSignInError("NotAuthorizedException");
87
+ setLoading(false);
88
+ }
89
+ }
90
+ } catch (error) {
91
+ console.log(error);
92
+ setLoading(false);
93
+ if (error.code === "NotAuthorizedException") {
94
+ setSignInError("NotAuthorizedException");
95
+ } else if (error.code === "UserNotConfirmedException") {
96
+ sessionStorage.setItem(
97
+ "email",
98
+ JSON.stringify(
99
+ document.querySelector("#usernameInput").value.trim()
100
+ )
101
+ );
102
+ sessionStorage.setItem("email", JSON.stringify(email));
103
+ props.setPaso(5);
104
+ } else {
105
+ setSignInError("Error");
106
+ }
107
+ }
108
+ }
25
109
  };
26
- return (
27
- <Container className={"home-login"}>
28
- <div className="main-container">
29
- <LogoImage />
30
- <div className="credenciales">
31
- <ScreenHeader
32
- fontFamily={FontFamily.AvenirNext}
33
- color={GlobalColors.s5}
34
- text={"Ingresa tus credenciales"}
35
- />
110
+ useEffect(() => {
111
+ sessionStorage.getItem("resetPasswordProcess") &&
112
+ sessionStorage.removeItem("resetPasswordProcess");
113
+ }, []);
114
+ return loading ? (
115
+ <Loading />
116
+ ) : (
117
+ <>
118
+ <Container className={"home-login"}>
119
+ <div className="main-container">
120
+ <LogoImage />
121
+ <div className="credenciales">
122
+ <ScreenHeader
123
+ fontFamily={FontFamily.AvenirNext}
124
+ color={GlobalColors.s5}
125
+ text={"Ingresa tus credenciales"}
126
+ />
127
+ </div>
128
+ <div className="user">
129
+ <TagAndInput
130
+ inputType={"text"}
131
+ label={"Nombre de usuario"}
132
+ inputPlaceHolder={"username@contentoh.com"}
133
+ inputId={"emailInput"}
134
+ />
135
+ </div>
136
+ {showErrors && emptyEmail && <label>Ingrese su correo</label>}
137
+ {invalidEmail && !emptyEmail && (
138
+ <label>Ingrese un correo válido</label>
139
+ )}
140
+ <div className="password">
141
+ <TagAndInput
142
+ inputType={"password"}
143
+ label={"Contraseña"}
144
+ inputPlaceHolder={"Escribe tu contraseña"}
145
+ inputId={"passwordInput"}
146
+ />
147
+ </div>
148
+ {showErrors && emptyPassword && <label>Ingrese su contraseña</label>}
149
+ <div className="select">
150
+ <CheckBox
151
+ label={"Mantener sesión activada"}
152
+ id={"chk-default"}
153
+ className="active-left"
154
+ />
155
+ <p onClick={() => props.setPaso(10)} className="active-right">Olvide mi contraseña</p>
156
+ </div>
157
+ {showErrors && signInError === "NotAuthorizedException" && (
158
+ <label>Correo o contraseña incorrectos</label>
159
+ )}
160
+ {showErrors && signInError === "Error" && (
161
+ <label>Ha habido un problema al iniciar sesión</label>
162
+ )}
163
+ <div className="button-right">
164
+ <Button
165
+ buttonType={"general-default-button"}
166
+ label={"Iniciar sesión"}
167
+ onClick={(e) => validate(e)}
168
+ />
169
+ </div>
170
+ <div className="new-login">
171
+ <p
172
+ className="pre-registro"
173
+ onClick={() => {
174
+ props.setPaso(1);
175
+ sessionStorage.setItem(
176
+ "nuevoRegistro",
177
+ JSON.stringify({
178
+ name: "",
179
+ lastName: "",
180
+ email: "",
181
+ position: "",
182
+ country: "",
183
+ phone: "",
184
+ commercialName: "",
185
+ companyName: "",
186
+ rfc: "",
187
+ adress: "",
188
+ })
189
+ );
190
+ sessionStorage.setItem("countryCode", JSON.stringify("+52"));
191
+ }}
192
+ >
193
+ ¿Aún no tienes cuenta?<span> Regístrate</span>
194
+ </p>
195
+ </div>
36
196
  </div>
37
- <div className="user">
38
- <TagAndInput
39
- inputType={"text"}
40
- label={"Nombre de usuario"}
41
- inputPlaceHolder={"username@contentoh.com"}
42
- inputId={"emailInput"}
43
- />
44
- </div>
45
- {emptyEmail && <label>Ingrese su correo</label>}
46
- {invalidEmail && !emptyEmail && <label>Ingrese un correo válido</label>}
47
- <div className="password">
48
- <TagAndInput
49
- inputType={"text"}
50
- label={"Contraseña"}
51
- inputPlaceHolder={"Escribe tu contraseña"}
52
- inputId={"passwordInput"}
53
- />
54
- </div>
55
- {emptyPassword && <label>Ingrese su contraseña</label>}
56
- <div className="select">
57
- <CheckBox
58
- label={"Mantener sesión activada"}
59
- id={"chk-default"}
60
- className="active-left"
61
- />
62
- <p className="active-right">Olvide mi contraseña</p>
63
- </div>
64
- <div className="button-right">
65
- <Button
66
- buttonType={"general-default-button"}
67
- label={"Iniciar sesión"}
68
- onClick={(e) => validate(e)}
69
- />
70
- </div>
71
- <div className="new-login">
72
- <p className="pre-registro">
73
- ¿Aún no tienes cuenta?<span> Regístrate</span>
74
- </p>
75
- </div>
76
- </div>
77
- </Container>
197
+ </Container>
198
+ {upgradePlanRedirect && <Redirect to={{ pathname: "/dashboard" }} />}
199
+ </>
78
200
  );
79
201
  };
@@ -5,6 +5,7 @@ export const Container = styled.div`
5
5
  background: "white";
6
6
  display: flex;
7
7
  height: 100%;
8
+ width: 50%;
8
9
  justify-content: center;
9
10
  align-items: center;
10
11
  label {
@@ -0,0 +1,11 @@
1
+ import { VerificationCodeResetPasswordLogin } from "./index";
2
+
3
+ export default {
4
+ title: "Components/molecules/VerificationCodeResetPasswordLogin",
5
+ component: VerificationCodeResetPasswordLogin,
6
+ };
7
+ const Template = (args) => <VerificationCodeResetPasswordLogin {...args} />;
8
+
9
+ export const VerificationCodeResetPasswordLoginDefault = Template.bind({});
10
+
11
+ VerificationCodeResetPasswordLoginDefault.args = {};
@@ -0,0 +1,78 @@
1
+ import { Container } from "./styles";
2
+ import { GradientPanel } from "../../atoms/GradientPanel";
3
+ import { useEffect, useState } from "react";
4
+ import { LogoImage } from "../../atoms/LogoImage";
5
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
6
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
7
+ import { GeneralInput } from "../../atoms/GeneralInput";
8
+ import { Button } from "../../atoms/GeneralButton";
9
+ import { validateInput, validate } from "./utils";
10
+
11
+ export const VerificationCodeResetPasswordLogin = () => {
12
+ const [emptyVerificationCode, setEmptyVerificationCode] = useState(false);
13
+ const [inputCodeVerificationAll, setInputCodeVerificationAll] = useState();
14
+ const inputPositions = [1, 2, 3, 4, 5, 6];
15
+
16
+ useEffect(() => {
17
+ setInputCodeVerificationAll(
18
+ document.querySelectorAll("[id^='verificationCodeInput']")
19
+ );
20
+ }, []);
21
+
22
+ const loginRight = [
23
+ <LogoImage key="1" />,
24
+ <div className="credenciales" key={"2"}>
25
+ <ScreenHeader
26
+ fontFamily={FontFamily.AvenirNext}
27
+ color={GlobalColors.s5}
28
+ text={"Ingresa tus credenciales"}
29
+ />
30
+ </div>,
31
+ <div className="user" key="3">
32
+ <ScreenHeader
33
+ text={"Ingresa el código de verificación enviado a:"}
34
+ headerType={"input-name-header"}
35
+ />
36
+ <div className="verification-code">
37
+ {inputPositions.map((position) => (
38
+ <GeneralInput
39
+ inputId={`verificationCodeInput${position}`}
40
+ inputType={"text"}
41
+ inputPlaceholder={"X"}
42
+ validateInput={validateInput}
43
+ inputsArray={inputCodeVerificationAll}
44
+ position={position}
45
+ maxLength="1"
46
+ />
47
+ ))}
48
+ </div>
49
+ {emptyVerificationCode && (
50
+ <label>Ingrese su código de verificación</label>
51
+ )}
52
+ </div>,
53
+ <div className="resend-code" key="4">
54
+ <p>Reenviar código de verificación</p>
55
+ </div>,
56
+ <div className="button-center" key="5">
57
+ <Button
58
+ buttonType={"general-default-button"}
59
+ label={"Enviar"}
60
+ onClick={(e) =>
61
+ validate(inputCodeVerificationAll, setEmptyVerificationCode)
62
+ }
63
+ />
64
+ </div>,
65
+ <div className="reset-password" key="6">
66
+ <p>Regresar...</p>
67
+ </div>,
68
+ ];
69
+ return (
70
+ <Container>
71
+ <GradientPanel
72
+ componentsArray={loginRight}
73
+ panelType={"home-login"}
74
+ panelColor={GlobalColors.white}
75
+ />
76
+ </Container>
77
+ );
78
+ };