97 lines
2.9 KiB
TypeScript
97 lines
2.9 KiB
TypeScript
import React, { useState } from 'react'
|
|
import Image from 'next/image';
|
|
import Link from 'next/link';
|
|
import { useRouter } from 'next/router'
|
|
|
|
import OutlinedInput from '@mui/material/OutlinedInput';
|
|
import InputLabel from '@mui/material/InputLabel';
|
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
import LoginButton from '../src/components/buttons/loginButton/LoginButton';
|
|
import FormControl from '@mui/material/FormControl';
|
|
import IconButton from '@mui/material/IconButton';
|
|
import TextField from '@mui/material/TextField';
|
|
|
|
import {AiOutlineEyeInvisible, AiOutlineEye} from 'react-icons/ai';
|
|
|
|
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({
|
|
amount: '',
|
|
password: '',
|
|
weight: '',
|
|
weightRange: '',
|
|
showPassword: false,
|
|
});
|
|
|
|
const router = useRouter()
|
|
const rota = router.pathname
|
|
|
|
const handleChange = (prop) => (event) => {
|
|
setValues({ ...values, [prop]: event.target.value });
|
|
};
|
|
|
|
const handleClickShowPassword = () => {
|
|
setValues({
|
|
...values,
|
|
showPassword: !values.showPassword,
|
|
});
|
|
};
|
|
|
|
const handleMouseDownPassword = (event) => {
|
|
event.preventDefault();
|
|
};
|
|
|
|
return (
|
|
<LoginView auth={rota} >
|
|
<Image src='/assets/marca1.svg' width={500} height={500} />
|
|
<LoginContainer>
|
|
<h1>Bem-Vindo</h1>
|
|
<h2>Estratégias Inteligentes em<br /> Gestão de Energia</h2>
|
|
|
|
<TextField id="outlined-basic" sx={{ m: 1, width: '90%' }}label="Login" variant="outlined" />
|
|
<FormControl sx={{ m: 1, width: '90%' }} variant="outlined">
|
|
<InputLabel htmlFor="outlined-adornment-password">Password</InputLabel>
|
|
<OutlinedInput
|
|
id="outlined-adornment-password"
|
|
type={values.showPassword ? 'text' : 'password'}
|
|
value={values.password}
|
|
onChange={handleChange('password')}
|
|
endAdornment={
|
|
<InputAdornment position="end">
|
|
<IconButton
|
|
aria-label="toggle password visibility"
|
|
onClick={handleClickShowPassword}
|
|
onMouseDown={handleMouseDownPassword}
|
|
edge="end"
|
|
>
|
|
{values.showPassword ? <AiOutlineEye /> : <AiOutlineEyeInvisible />}
|
|
</IconButton>
|
|
</InputAdornment>
|
|
}
|
|
label="Password"
|
|
/>
|
|
</FormControl>
|
|
<span>Esqueceu a senha ?</span>
|
|
|
|
<Link href='/dashboard' >
|
|
<LoginButton title='ENTRAR' />
|
|
</Link>
|
|
|
|
<fieldset className="line">
|
|
<legend className="text">Ou</legend>
|
|
</fieldset>
|
|
|
|
<p>+55(41) 3012-5900<br/>www.energiasmart.com.br</p>
|
|
|
|
</LoginContainer>
|
|
</LoginView>
|
|
)
|
|
}
|
|
|
|
|