diff --git a/src/components/buttons/loginButton/LoginButton.tsx b/src/components/buttons/loginButton/LoginButton.tsx index 54214a8..100b60b 100644 --- a/src/components/buttons/loginButton/LoginButton.tsx +++ b/src/components/buttons/loginButton/LoginButton.tsx @@ -1,17 +1,29 @@ -import Link from 'next/link' import React from 'react' +import Link from 'next/link' +import RenderIf from '../../../utils/renderIf' import { LoginButtonView } from './LoginButtonView' interface LoginButtonInterface { - title: string + title: string, + link?: boolean | undefined, + onClick?: () => void } -export default function LoginButton({ title }: LoginButtonInterface) { +export default function LoginButton({ title, link, onClick }: LoginButtonInterface) { return ( - - - {title} - - + <> + + + + {title} + + + + + onClick()}> + {title} + + + ) } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 9061251..2e82426 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -12,6 +12,8 @@ import '../styles/globals.ts' import Home from '.' import Head from 'next/head' +import VerifyEmail from './verifyEmail' +import ForgotPassword from './forgotPassword' function MyApp({ Component, pageProps }: AppProps) { const router = useRouter() @@ -43,9 +45,11 @@ function MyApp({ Component, pageProps }: AppProps) { + + { - rota != '/'? + rota != '/' && rota != '/forgotPassword' && rota != '/verifyEmail'? <> diff --git a/src/pages/forgotPassword.tsx b/src/pages/forgotPassword.tsx new file mode 100644 index 0000000..d77e3f8 --- /dev/null +++ b/src/pages/forgotPassword.tsx @@ -0,0 +1,42 @@ +import React, { useState, useEffect } from 'react' +import Image from 'next/image'; +import { useRouter } from 'next/router' + +import LoginButton from '../components/buttons/loginButton/LoginButton'; +import TextField from '@mui/material/TextField'; +import { ForgotPasswordContainer, ForgotPasswordView } from '../styles/layouts/forgotPassword/ForgotPasswordView'; + +export default function ForgotPassword() { + const router = useRouter() + const rota = router.pathname + + const [password, setPassword] = useState('') + const [confirmPassword, setConfirmPassword] = useState('') + + useEffect(() => { + setPassword('') + setConfirmPassword('') + }, [rota]) + + return ( + + + +

Bem-Vindo

+

Estratégias Inteligentes em
Gestão de Energia

+ + setPassword(value.target.value)} variant="outlined"/> + setConfirmPassword(value.target.value)} variant="outlined"/> + + router.push('/')} /> + +
+ Ou +
+ +

+55(41) 3012-5900
www.energiasmart.com.br

+ +
+
+ ) +} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 5bda949..d7179e7 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -18,9 +18,6 @@ import { LoginView, LoginContainer } from '../styles/layouts/login/LoginView'; export default function Home() { const [state, setstate]=useState(false); - const toggleBtn = ()=> { - setstate(prevState => !prevState); - } const [values, setValues] = React.useState({ password: '', showPassword: false, @@ -74,9 +71,9 @@ export default function Home() { label="Password" /> - Esqueceu a senha ? + Esqueceu a senha ? - +
Ou diff --git a/src/pages/verifyEmail.tsx b/src/pages/verifyEmail.tsx new file mode 100644 index 0000000..b42a5ed --- /dev/null +++ b/src/pages/verifyEmail.tsx @@ -0,0 +1,62 @@ +import React, { useEffect, useState } from 'react' +import Image from 'next/image'; +import { useRouter } from 'next/router' + +import LoginButton from '../components/buttons/loginButton/LoginButton'; +import TextField from '@mui/material/TextField'; + +import {AiOutlineEyeInvisible, AiOutlineEye} from 'react-icons/ai'; + +import { ForgotPasswordContainer, ForgotPasswordView } from '../styles/layouts/forgotPassword/ForgotPasswordView'; +import { VerifyEmailContainer, VerifyEmailView } from '../styles/layouts/forgotPassword/verifyEmail'; + +export default function VerifyEmail() { + const [sent, setSent]=useState(false); + const [code, setCode]=useState(''); + + const [values, setValues] = React.useState({ + password: '', + showPassword: false, + }); + + const router = useRouter() + const rota = router.pathname + + useEffect(() => { + if (code === '0000') { + router.push('/forgotPassword') + } + }, [code]) + + useEffect(() => { + setCode('') + setSent(false) + }, [rota]) + + return ( + + + +

Bem-Vindo

+

Estratégias Inteligentes em
Gestão de Energia

+ + + { + sent? + setCode(value.target.value)} /> + : + null + } + + setSent(true)} /> + +
+ Ou +
+ +

+55(41) 3012-5900
www.energiasmart.com.br

+ +
+
+ ) +} diff --git a/src/styles/layouts/forgotPassword/ForgotPasswordView.ts b/src/styles/layouts/forgotPassword/ForgotPasswordView.ts new file mode 100644 index 0000000..e6f35ce --- /dev/null +++ b/src/styles/layouts/forgotPassword/ForgotPasswordView.ts @@ -0,0 +1,101 @@ + +import styled from 'styled-components'; + +export const ForgotPasswordView = styled.main<{auth: string}>` + display: flex; + display: ${props => props.auth == '/forgotPassword'? null : 'none'}; + justify-content: flex-end; + align-items: center; + + width: 100%; + height: 100vh; + + padding: 0; + margin: 0; + + @media (max-width: 1196px) { + flex-direction: column; + justify-content: flex-start; + align-items: center; + + height: 100%; + + padding: 100px; + } +`; + +export const ForgotPasswordContainer = styled.section` + display: flex; + justify-content: center; + align-items: center; + + flex-direction: column; + + width: 40%; + margin-left: 60px; + + border-radius: 10px; + + background-color: #FFF; + + h1{ + margin-bottom:5px; + color: #092C4C; + } + + h2{ + font-weight: 5; + font-size: 21px; + margin-bottom: 3rem; + color: #092C4C; + font-weight: 300; + text-align: center; + } + + .line { + border-top: 0.7px solid #E1E1E1; + border-bottom: none; + border-left: none; + border-right: none; + display: block; + text-align: center; + width: 90%; + } + + .line .text { + padding: 19px 56px; + color: #ABB3BB; + font-size: 14px; + } + + span{ + display: flex; + align-self: flex-end; + margin-right: 5%; + justify-content: flex-end; + cursor: pointer; + } + a { + :nth-child(5) { + align-self: flex-end; + margin-right: 5%; + margin-bottom: 40px; + color: #5d83fc; + } + } + + p{ + color: #8B8B8B; + text-align: center; + margin-top: 1px; + } + + @media (max-width: 1196px) { + flex-direction: column; + justify-content: center; + align-items: center; + + width: 100%; + margin: 0; + } +`; diff --git a/src/styles/layouts/forgotPassword/verifyEmail.ts b/src/styles/layouts/forgotPassword/verifyEmail.ts new file mode 100644 index 0000000..fe7cd7a --- /dev/null +++ b/src/styles/layouts/forgotPassword/verifyEmail.ts @@ -0,0 +1,101 @@ + +import styled from 'styled-components'; + +export const VerifyEmailView = styled.main<{auth: string}>` + display: flex; + display: ${props => props.auth == '/verifyEmail'? null : 'none'}; + justify-content: flex-end; + align-items: center; + + width: 100%; + height: 100vh; + + padding: 0; + margin: 0; + + @media (max-width: 1196px) { + flex-direction: column; + justify-content: flex-start; + align-items: center; + + height: 100%; + + padding: 100px; + } +`; + +export const VerifyEmailContainer = styled.section` + display: flex; + justify-content: center; + align-items: center; + + flex-direction: column; + + width: 40%; + margin-left: 60px; + + border-radius: 10px; + + background-color: #FFF; + + h1{ + margin-bottom:5px; + color: #092C4C; + } + + h2{ + font-weight: 5; + font-size: 21px; + margin-bottom: 3rem; + color: #092C4C; + font-weight: 300; + text-align: center; + } + + .line { + border-top: 0.7px solid #E1E1E1; + border-bottom: none; + border-left: none; + border-right: none; + display: block; + text-align: center; + width: 90%; + } + + .line .text { + padding: 19px 56px; + color: #ABB3BB; + font-size: 14px; + } + + span{ + display: flex; + align-self: flex-end; + margin-right: 5%; + justify-content: flex-end; + cursor: pointer; + } + a { + :nth-child(5) { + align-self: flex-end; + margin-right: 5%; + margin-bottom: 40px; + color: #5d83fc; + } + } + + p{ + color: #8B8B8B; + text-align: center; + margin-top: 1px; + } + + @media (max-width: 1196px) { + flex-direction: column; + justify-content: center; + align-items: center; + + width: 100%; + margin: 0; + } +`; diff --git a/src/styles/layouts/login/LoginView.ts b/src/styles/layouts/login/LoginView.ts index e8b680e..2248f55 100644 --- a/src/styles/layouts/login/LoginView.ts +++ b/src/styles/layouts/login/LoginView.ts @@ -75,6 +75,14 @@ export const LoginContainer = styled.section` justify-content: flex-end; cursor: pointer; } + a { + :nth-child(5) { + align-self: flex-end; + margin-right: 5%; + margin-bottom: 40px; + color: #5d83fc; + } + } p{ color: #8B8B8B;