contentoh-components-library 21.0.28 → 21.0.31
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/.env.development +18 -3
- package/.env.production +16 -1
- package/CHANGELOG.md +31 -33
- package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
- package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
- package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
- package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
- package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
- package/dist/components/atoms/AsignationOption/index.js +9 -5
- package/dist/components/atoms/AsignationOption/styles.js +1 -1
- package/dist/components/{molecules/SignInLogin/SignInLogin.stories.js → atoms/CharCounter/CharCounter.stories.js} +10 -7
- package/dist/components/atoms/CharCounter/index.js +22 -0
- package/dist/components/{molecules/ApproveRejetPanel → atoms/CharCounter}/styles.js +3 -1
- package/dist/components/atoms/CheckBox/index.js +4 -2
- package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
- package/dist/components/atoms/Commentary/index.js +23 -0
- package/dist/components/atoms/{VerticalSideMenuMainPage → Commentary}/styles.js +6 -1
- package/dist/components/atoms/GeneralButton/index.js +5 -0
- package/dist/components/atoms/GeneralButton/styles.js +4 -2
- package/dist/components/atoms/GeneralInput/index.js +73 -24
- package/dist/components/atoms/GeneralInput/styles.js +7 -1
- package/dist/components/atoms/GenericModal/index.js +4 -2
- package/dist/components/atoms/GenericModal/styles.js +1 -1
- package/dist/components/atoms/Input/index.js +26 -0
- package/dist/components/atoms/Input/style.js +26 -0
- package/dist/components/{organisms/ChangePassword/ChangePassword.stories.js → atoms/InputFormatter/Wysiwyg.stories.js} +9 -7
- package/dist/components/atoms/InputFormatter/index.js +185 -0
- package/dist/components/atoms/InputFormatter/styles.js +33 -0
- package/dist/components/atoms/LabelToInput/index.js +53 -0
- package/dist/components/atoms/LabelToInput/style.js +22 -0
- package/dist/components/atoms/Loading/index.js +1 -2
- package/dist/components/atoms/Loading/styles.js +8 -4
- package/dist/components/atoms/Percent/Percent.stories.js +39 -0
- package/dist/components/atoms/Percent/index.js +39 -0
- package/dist/components/atoms/Percent/styles.js +20 -0
- package/dist/components/atoms/PriorityFlag/index.js +1 -1
- package/dist/components/atoms/ProductImage/styles.js +1 -1
- package/dist/components/atoms/ProgressBar/index.js +2 -2
- package/dist/components/atoms/ProgressBar/styles.js +3 -5
- package/dist/components/atoms/ScreenHeader/index.js +1 -1
- package/dist/components/atoms/ScreenHeader/styles.js +1 -1
- package/dist/components/atoms/Select/index.js +39 -0
- package/dist/components/atoms/Select/style.js +32 -0
- package/dist/components/atoms/StatusTag/index.js +37 -2
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/atoms/ValidationPanel/index.js +4 -3
- package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
- package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +42 -40
- package/dist/components/molecules/FeaturesBar/index.js +1 -1
- package/dist/components/molecules/GalleryElement/index.js +80 -21
- package/dist/components/molecules/GalleryElement/styles.js +1 -1
- package/dist/components/molecules/GalleryHeader/index.js +28 -6
- package/dist/components/molecules/GalleryHeader/styles.js +1 -1
- package/dist/components/molecules/ImageSelector/index.js +2 -4
- package/dist/components/molecules/ProductNameHeader/index.js +1 -2
- package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +48 -0
- package/dist/components/molecules/RetailerSelector/index.js +74 -0
- package/dist/components/{atoms/MenuCommercialRetailers → molecules/RetailerSelector}/styles.js +1 -1
- package/dist/components/molecules/StatusAsignationInfo/index.js +46 -25
- package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
- package/dist/components/molecules/TableHeader/index.js +12 -5
- package/dist/components/molecules/TableHeader/styles.js +1 -1
- package/dist/components/molecules/TagAndInput/index.js +26 -2
- package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
- package/dist/components/molecules/TextAndGradient/index.js +36 -0
- package/dist/components/molecules/TextAndGradient/styles.js +18 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +32 -8
- package/dist/components/organisms/FullTabsMenu/index.js +18 -5
- package/dist/components/organisms/ImageDataTable/index.js +90 -14
- package/dist/components/organisms/InputGroup/index.js +34 -13
- package/dist/components/organisms/InputGroup/styles.js +1 -1
- package/dist/components/organisms/ProductImageModal/index.js +15 -11
- package/dist/components/organisms/ProductImageModal/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +109 -347
- package/dist/components/pages/RetailerProductEdition/index.js +1589 -59
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/global-files/data.js +212 -53
- package/dist/global-files/global-styles.css +1 -0
- package/dist/global-files/variables.js +1 -0
- package/dist/index.js +30 -238
- package/package.json +12 -10
- package/src/assets/images/generalButton/downloadIcon.svg +3 -0
- package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
- package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
- package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
- package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
- package/src/components/atoms/AsignationOption/index.js +7 -5
- package/src/components/atoms/AsignationOption/styles.js +9 -1
- package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
- package/src/components/atoms/CharCounter/index.js +13 -0
- package/src/components/atoms/CharCounter/styles.js +10 -0
- package/src/components/atoms/CheckBox/index.js +8 -2
- package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
- package/src/components/atoms/Commentary/index.js +9 -0
- package/src/components/atoms/Commentary/styles.js +16 -0
- package/src/components/atoms/GeneralButton/index.js +9 -2
- package/src/components/atoms/GeneralButton/styles.js +23 -0
- package/src/components/atoms/GeneralInput/index.js +71 -21
- package/src/components/atoms/GeneralInput/styles.js +11 -1
- package/src/components/atoms/GenericModal/index.js +2 -2
- package/src/components/atoms/GenericModal/styles.js +10 -2
- package/src/components/atoms/Input/index.js +15 -0
- package/src/components/atoms/Input/style.js +31 -0
- package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/InputFormatter/index.js +141 -0
- package/src/components/atoms/InputFormatter/styles.js +40 -0
- package/src/components/atoms/LabelToInput/index.js +26 -0
- package/src/components/atoms/LabelToInput/style.js +41 -0
- package/src/components/atoms/Loading/index.js +4 -5
- package/src/components/atoms/Loading/styles.js +43 -43
- package/src/components/atoms/PriorityFlag/index.js +1 -1
- package/src/components/atoms/ProductImage/styles.js +1 -1
- package/src/components/atoms/ProgressBar/index.js +2 -2
- package/src/components/atoms/ProgressBar/styles.js +54 -3
- package/src/components/atoms/ScreenHeader/index.js +7 -3
- package/src/components/atoms/ScreenHeader/styles.js +9 -2
- package/src/components/atoms/Select/index.js +35 -0
- package/src/components/atoms/Select/style.js +76 -0
- package/src/components/atoms/StatusTag/index.js +30 -2
- package/src/components/atoms/StatusTag/styles.js +15 -3
- package/src/components/atoms/ValidationPanel/index.js +3 -3
- package/src/components/molecules/AvatarAndValidation/index.js +24 -6
- package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +37 -34
- package/src/components/molecules/FeaturesBar/index.js +10 -7
- package/src/components/molecules/GalleryElement/index.js +75 -36
- package/src/components/molecules/GalleryElement/styles.js +38 -11
- package/src/components/molecules/GalleryHeader/index.js +14 -8
- package/src/components/molecules/GalleryHeader/styles.js +16 -0
- package/src/components/molecules/ImageSelector/index.js +2 -3
- package/src/components/molecules/ProductNameHeader/index.js +1 -2
- package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
- package/src/components/molecules/RetailerSelector/index.js +63 -0
- package/src/components/molecules/RetailerSelector/styles.js +18 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +62 -38
- package/src/components/molecules/StatusAsignationInfo/styles.js +12 -2
- package/src/components/molecules/TableHeader/index.js +16 -3
- package/src/components/molecules/TableHeader/styles.js +5 -0
- package/src/components/molecules/TagAndInput/index.js +24 -0
- package/src/components/organisms/FullProductNameHeader/index.js +28 -7
- package/src/components/organisms/FullTabsMenu/index.js +15 -3
- package/src/components/organisms/ImageDataTable/index.js +89 -11
- package/src/components/organisms/InputGroup/index.js +46 -11
- package/src/components/organisms/InputGroup/styles.js +3 -0
- package/src/components/organisms/ProductImageModal/index.js +20 -12
- package/src/components/organisms/ProductImageModal/styles.js +3 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +117 -343
- package/src/components/pages/RetailerProductEdition/index.js +1225 -46
- package/src/components/pages/RetailerProductEdition/styles.js +67 -4
- package/src/global-files/data.js +156 -57
- package/src/global-files/global-styles.css +1 -0
- package/src/global-files/variables.js +1 -0
- package/src/index.js +1 -17
- package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
- package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
- package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
- package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
- package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
- package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/Loading/Loading.stories.js +0 -28
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
- package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
- package/dist/components/atoms/MenuProductImage/index.js +0 -88
- package/dist/components/atoms/MenuProductImage/styles.js +0 -20
- package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +0 -22
- package/dist/components/atoms/VerticalSideMenuMainPage/index.js +0 -49
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
- package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
- package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -28
- package/dist/components/molecules/EmailResetPasswordLogin/index.js +0 -159
- package/dist/components/molecules/EmailResetPasswordLogin/styles.js +0 -20
- package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -28
- package/dist/components/molecules/RegistrationFirstStep/index.js +0 -371
- package/dist/components/molecules/RegistrationFirstStep/styles.js +0 -20
- package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -28
- package/dist/components/molecules/RegistrationSecondStep/index.js +0 -156
- package/dist/components/molecules/RegistrationSecondStep/styles.js +0 -20
- package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -28
- package/dist/components/molecules/RegistrationThirdStep/index.js +0 -161
- package/dist/components/molecules/RegistrationThirdStep/styles.js +0 -20
- package/dist/components/molecules/SignInLogin/index.js +0 -292
- package/dist/components/molecules/SignInLogin/styles.js +0 -20
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -28
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -104
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -20
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -69
- package/dist/components/organisms/ChangePassword/index.js +0 -113
- package/dist/components/organisms/ChangePassword/styles.js +0 -18
- package/src/components/atoms/Loading/Loading.stories.js +0 -10
- package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -11
- package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -87
- package/src/components/molecules/EmailResetPasswordLogin/styles.js +0 -23
- package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -11
- package/src/components/molecules/RegistrationFirstStep/index.js +0 -259
- package/src/components/molecules/RegistrationFirstStep/styles.js +0 -81
- package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -11
- package/src/components/molecules/RegistrationSecondStep/index.js +0 -97
- package/src/components/molecules/RegistrationSecondStep/styles.js +0 -59
- package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -11
- package/src/components/molecules/RegistrationThirdStep/index.js +0 -109
- package/src/components/molecules/RegistrationThirdStep/styles.js +0 -44
- package/src/components/molecules/SignInLogin/SignInLogin.stories.js +0 -11
- package/src/components/molecules/SignInLogin/index.js +0 -205
- package/src/components/molecules/SignInLogin/styles.js +0 -78
- package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -11
- package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -78
- package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -49
- package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -56
- package/src/components/organisms/ChangePassword/ChangePassword.stories.js +0 -11
- package/src/components/organisms/ChangePassword/index.js +0 -63
- package/src/components/organisms/ChangePassword/styles.js +0 -16
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
height: 100%;
|
|
7
|
-
width: 50%;
|
|
8
|
-
.button-center {
|
|
9
|
-
text-align: center;
|
|
10
|
-
.general-default-button {
|
|
11
|
-
width: 160px;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
.reset-password {
|
|
15
|
-
text-align: center;
|
|
16
|
-
margin: 15px !important;
|
|
17
|
-
color: ${GlobalColors.secondary_magenta};
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
font-weight: bold;
|
|
20
|
-
font-family: ${FontFamily.Raleway};
|
|
21
|
-
font-size: 13px;
|
|
22
|
-
}
|
|
23
|
-
.resend-code {
|
|
24
|
-
margin-top: 8px !important;
|
|
25
|
-
color: ${GlobalColors.magenta_s2};
|
|
26
|
-
font-family: ${FontFamily.AvenirNext};
|
|
27
|
-
font-size: 11px;
|
|
28
|
-
text-decoration: underline rgb(228, 81, 172);
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
& + * {
|
|
31
|
-
margin-top: 30px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
.verification-code {
|
|
35
|
-
display: flex;
|
|
36
|
-
text-align: center;
|
|
37
|
-
margin: auto;
|
|
38
|
-
margin-top: 10px;
|
|
39
|
-
input[type="number"]::-webkit-inner-spin-button,
|
|
40
|
-
input[type="number"]::-webkit-outer-spin-button {
|
|
41
|
-
-webkit-appearance: none;
|
|
42
|
-
margin: 0;
|
|
43
|
-
}
|
|
44
|
-
input {
|
|
45
|
-
width: 70%;
|
|
46
|
-
text-align: center;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {event} e event received triggered by verification code input
|
|
4
|
-
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
5
|
-
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
6
|
-
*/
|
|
7
|
-
export const validateInput = (e, index, inputsArray) => {
|
|
8
|
-
let isValid = false;
|
|
9
|
-
const inputNotEmpty = e.target.value.length > 0;
|
|
10
|
-
if (inputNotEmpty) {
|
|
11
|
-
if (validateInputNumber(e) !== null) {
|
|
12
|
-
isValid = true;
|
|
13
|
-
nextInputFocus(inputsArray, index++);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return isValid ? e.target.value : "";
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param {event} e event received triggered by verification code input
|
|
22
|
-
* @returns {boolean} if digit is a number
|
|
23
|
-
*/
|
|
24
|
-
const validateInputNumber = (e) => {
|
|
25
|
-
return (e.target.value || String.fromCharCode(e.keyCode)).match(/[0-9]{1}/);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
31
|
-
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
32
|
-
* changes focus to next input if digit typed is a number and there wasn't any before
|
|
33
|
-
*/
|
|
34
|
-
const nextInputFocus = (inputsArray, index) => {
|
|
35
|
-
const button = document.getElementsByClassName("general-default-button");
|
|
36
|
-
|
|
37
|
-
inputsArray?.length && index === inputsArray?.length
|
|
38
|
-
? button[0].focus()
|
|
39
|
-
: inputsArray[index]?.focus();
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to check if there's any empty)
|
|
45
|
-
* @param {function} setEmptyVerificationCode function to update flag which handles if there's an empty char
|
|
46
|
-
* updates emptyVerificationFlag from father component
|
|
47
|
-
*/
|
|
48
|
-
export const validate = (inputsArray, setEmptyVerificationCode) => {
|
|
49
|
-
let contInputEmpty = 0;
|
|
50
|
-
inputsArray.forEach((element) => {
|
|
51
|
-
element.value === "" ? 0 : contInputEmpty++;
|
|
52
|
-
});
|
|
53
|
-
contInputEmpty === inputsArray.length
|
|
54
|
-
? setEmptyVerificationCode(false)
|
|
55
|
-
: setEmptyVerificationCode(true);
|
|
56
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ChangePassword } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/organisms/ChangePassword",
|
|
5
|
-
component: ChangePassword,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => <ChangePassword {...args} />;
|
|
8
|
-
|
|
9
|
-
export const ChangePasswordDefault = Template.bind({});
|
|
10
|
-
|
|
11
|
-
ChangePasswordDefault.args = {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Container } from "./styles";
|
|
2
|
-
import { LoginPasswordStrength } from "../../molecules/LoginPasswordStrength";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Button } from "../../atoms/GeneralButton";
|
|
5
|
-
import { LogoImage } from "../../atoms/LogoImage";
|
|
6
|
-
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
7
|
-
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
8
|
-
import { GradientPanel } from "../../atoms/GradientPanel";
|
|
9
|
-
|
|
10
|
-
export const ChangePassword = () => {
|
|
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
|
-
emptyPassword={emptyPassword}
|
|
41
|
-
emptyConfirmPassword={emptyConfirmPassword}
|
|
42
|
-
matchPasswords={matchPasswords}
|
|
43
|
-
textTittle={"Ingresa tus credenciales"}
|
|
44
|
-
key="3"
|
|
45
|
-
/>,
|
|
46
|
-
<div className="button-center" key="4">
|
|
47
|
-
<Button
|
|
48
|
-
buttonType={"general-default-button"}
|
|
49
|
-
label={"Enviar"}
|
|
50
|
-
onClick={(e) => validate(e)}
|
|
51
|
-
/>
|
|
52
|
-
</div>,
|
|
53
|
-
];
|
|
54
|
-
return (
|
|
55
|
-
<Container>
|
|
56
|
-
<GradientPanel
|
|
57
|
-
panelColor={GlobalColors.white}
|
|
58
|
-
componentsArray={loginRight}
|
|
59
|
-
panelType={"home-login"}
|
|
60
|
-
></GradientPanel>
|
|
61
|
-
</Container>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
export const Container = styled.div`
|
|
4
|
-
display: flex;
|
|
5
|
-
width: 50%;
|
|
6
|
-
height: 100vh;
|
|
7
|
-
.button-center {
|
|
8
|
-
text-align: center;
|
|
9
|
-
position: absolute;
|
|
10
|
-
bottom: 5%;
|
|
11
|
-
left: calc(75% - 80px);
|
|
12
|
-
.general-default-button {
|
|
13
|
-
width: 160px;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
`;
|