diff --git a/next/pages/user/check-email.js b/next/pages/user/check-email.js new file mode 100644 index 00000000..72046e79 --- /dev/null +++ b/next/pages/user/check-email.js @@ -0,0 +1,96 @@ +import { + Stack, + Text, +} from "@chakra-ui/react"; +import { useState, useEffect } from "react"; + +import Display from "../../components/atoms/Display"; +import { isMobileMod } from "../../hooks/useCheckMobile.hook" +import { MainPageTemplate } from "../../components/templates/main"; + +import { EmailConfirmImage } from "../../public/img/emailImage"; + +export default function CheckEmail() { + const [email, setEmail] = useState("") + + useEffect(() => { + + }, []) + + return ( + + + + + Confirme seu endereço de e-mail + + + + Enviamos uma confirmação de e-mail para + + + + seuemail@gmail.com + + + + + + Confira sua caixa de entrada e siga as instruções enviadas no e-mail para completar o cadastro. + + + Reenviar e-mail + + + + ) +} \ No newline at end of file diff --git a/next/pages/user/login.js b/next/pages/user/login.js index 072fa54d..94608962 100644 --- a/next/pages/user/login.js +++ b/next/pages/user/login.js @@ -225,7 +225,7 @@ export default function Login() { _hover={{opacity: "0.6"}} marginLeft="2px" onClick={() => window.open("./register", "_self")} - >{" "}cadastre-se + >{" "}Cadastre-se . diff --git a/next/pages/user/password-recovery.js b/next/pages/user/password-recovery.js index 201a24ed..ad373461 100644 --- a/next/pages/user/password-recovery.js +++ b/next/pages/user/password-recovery.js @@ -1,214 +1,102 @@ import { Stack, + Text, FormControl, FormLabel, - FormErrorMessage, - UnorderedList, - ListItem + Input } from "@chakra-ui/react"; import { useState } from "react"; -import { useRouter } from "next/router"; -import Input from "../../components/atoms/SimpleInput"; +import Display from "../../components/atoms/Display"; +import Link from "../../components/atoms/Link"; import Button from "../../components/atoms/RoundedButton"; +import { isMobileMod } from "../../hooks/useCheckMobile.hook" import { MainPageTemplate } from "../../components/templates/main"; -import { EyeIcon, EyeOffIcon } from "../../public/img/icons/eyeIcon"; +import { EmailRecoveryImage } from "../../public/img/emailImage"; export default function PasswordRecovery() { - const router = useRouter() - const query = router.query - - const [formData, setFormData] = useState({ - email: "", - password: "", - confirmPassword: "" - }) - const [errors, setErrors] = useState({ - email: "", - password: "", - regexPassword: { - amount: false, - uppercaseLowercase: false, - number: false, - special: false - }, - confirmPassword: "" - }) - const [showPassword, setShowPassword] = useState(true) - const [showConfirmPassword, setShowConfirmPassword] = useState(true) - - const handleInputChange = (e) => { - setFormData((prevState) => ({ - ...prevState, - [e.target.name]: e.target.value, - })) - } - - const handleSubmit = (e) => { - const regexPassword = {} - const validationErrors = {} - e.preventDefault() - - if (!formData.email) { - validationErrors.email = "O email é necessário" - } - if (!/^\S+@\S+$/.test(formData.email)) { - validationErrors.email = "Email inválido" - } - if(!/^.{8,}$/.test(formData.password)) { - regexPassword = {...regexPassword, amount: true} - } - if(!/([a-z].*[A-Z])|([A-Z].*[a-z])/.test(formData.password)) { - regexPassword = {...regexPassword, uppercaseLowercase: true} - } - if(!/(?=.*?[0-9])/.test(formData.password)) { - regexPassword = {...regexPassword, number: true} - } - if(!/(?=.*?[#?!@$%^&*-])/.test(formData.password)) { - regexPassword = {...regexPassword, special: true} - } - if (!formData.password) { - validationErrors.password = "A senha é necessária" - } - if (!formData.confirmPassword) { - validationErrors.confirmPassword = "Confirmar a senha é necessário" - } - if(formData.confirmPassword !== formData.password) { - validationErrors.confirmPassword = "As senhas tem que ser iguais" - } - - if (Object.keys(regexPassword).length != 0) validationErrors.regexPassword = regexPassword - setErrors(validationErrors) - - if (Object.keys(validationErrors).length === 0) { - fetchPasswordRecovery(formData) - } - } - - const fetchPasswordRecovery = async ({}) => { - } - - const LabelTextForm = ({ text }) => { - return ( - {text} - ) - } + const [email, setEmail] = useState("") return ( - {!query.id && !query.token && - - - - {errors.email} - - } + + + Redefina sua senha - {query.id && query.token && - <> - - - setShowPassword(!showPassword) - }} - elmRight={showPassword ? - - : - - } - /> - - Ter no mínimo 8 caracteres - Pelo menos uma letra maiúscula e minúscula - Um dígito - E um caractere especial - - {errors.password} - + + Insira o endereço de e-mail que você usou para cadastrar sua conta. Enviaremos as instruções para você redefinir sua senha. + - - - setShowConfirmPassword(!showConfirmPassword) - }} - elmRight={showConfirmPassword ? - - : - - } - /> - {errors.confirmPassword} - - - } + + E-mail + setEmail(e.target.value)} + padding="8px 12px 8px 16px" + borderRadius="16px" + fontSize="14px" + lineHeight="27px" + letterSpacing="0.3px" + border="1px solid #DEDFE0 !important" + /> + + + + Se ainda precisar de ajuda, entre em contato. + ) diff --git a/next/pages/user/register.js b/next/pages/user/register.js index d93c88b6..009b5c5d 100644 --- a/next/pages/user/register.js +++ b/next/pages/user/register.js @@ -330,7 +330,7 @@ export default function Register() { letterSpacing= "0.3px" marginTop="24px !important" > - Já tem uma conta? Faça login. + Já tem uma conta? Faça login. diff --git a/next/public/img/emailImage.js b/next/public/img/emailImage.js new file mode 100644 index 00000000..f5858f3f --- /dev/null +++ b/next/public/img/emailImage.js @@ -0,0 +1,50 @@ +import { Icon, Box } from '@chakra-ui/react' + +export const EmailRecoveryImage = ({widthImage = "161px", heightImage="90px", ...style}) => ( + + + + + + + + + + + + + +) + +export const EmailConfirmImage = ({widthImage = "126px", heightImage="90px", ...style}) => ( + + + + + + + + +)