Update background and add password visibility
Updated the background of the authentication page to a modern design without the previous grid effect. Added a password visibility toggle (eye icon) to the password and confirm password fields in the registration form.
This commit is contained in:
parent
13261836a0
commit
f9e15c066b
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { Eye, EyeOff } from 'lucide-react';
|
||||||
|
|
||||||
interface RegisterFormFieldsProps {
|
interface RegisterFormFieldsProps {
|
||||||
nome: string;
|
nome: string;
|
||||||
@ -33,6 +35,9 @@ const RegisterFormFields = ({
|
|||||||
setConfirmaSenha,
|
setConfirmaSenha,
|
||||||
isLoading
|
isLoading
|
||||||
}: RegisterFormFieldsProps) => {
|
}: RegisterFormFieldsProps) => {
|
||||||
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
@ -82,27 +87,55 @@ const RegisterFormFields = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label htmlFor="senha">Senha</Label>
|
<Label htmlFor="senha">Senha</Label>
|
||||||
|
<div className="relative">
|
||||||
<Input
|
<Input
|
||||||
id="senha"
|
id="senha"
|
||||||
placeholder="Senha"
|
placeholder="Senha"
|
||||||
type="password"
|
type={showPassword ? "text" : "password"}
|
||||||
value={senha}
|
value={senha}
|
||||||
onChange={(e) => setSenha(e.target.value)}
|
onChange={(e) => setSenha(e.target.value)}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
required
|
required
|
||||||
|
className="pr-10"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="absolute inset-y-0 right-0 pr-3 flex items-center"
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
>
|
||||||
|
{showPassword ? (
|
||||||
|
<EyeOff className="h-4 w-4 text-gray-400" />
|
||||||
|
) : (
|
||||||
|
<Eye className="h-4 w-4 text-gray-400" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label htmlFor="confirma-senha">Confirme a senha</Label>
|
<Label htmlFor="confirma-senha">Confirme a senha</Label>
|
||||||
|
<div className="relative">
|
||||||
<Input
|
<Input
|
||||||
id="confirma-senha"
|
id="confirma-senha"
|
||||||
placeholder="Confirme a senha"
|
placeholder="Confirme a senha"
|
||||||
type="password"
|
type={showConfirmPassword ? "text" : "password"}
|
||||||
value={confirmaSenha}
|
value={confirmaSenha}
|
||||||
onChange={(e) => setConfirmaSenha(e.target.value)}
|
onChange={(e) => setConfirmaSenha(e.target.value)}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
required
|
required
|
||||||
|
className="pr-10"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="absolute inset-y-0 right-0 pr-3 flex items-center"
|
||||||
|
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
|
||||||
|
>
|
||||||
|
{showConfirmPassword ? (
|
||||||
|
<EyeOff className="h-4 w-4 text-gray-400" />
|
||||||
|
) : (
|
||||||
|
<Eye className="h-4 w-4 text-gray-400" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { useState, useEffect } from 'react';
|
|||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import { Boxes } from "@/components/ui/background-boxes";
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { ArrowLeft } from "lucide-react";
|
import { ArrowLeft } from "lucide-react";
|
||||||
import LoginForm from '@/components/auth/LoginForm';
|
import LoginForm from '@/components/auth/LoginForm';
|
||||||
@ -49,12 +48,10 @@ const Auth = () => {
|
|||||||
|
|
||||||
if (showForgotPassword) {
|
if (showForgotPassword) {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen relative w-full overflow-hidden bg-gradient-primary flex items-center justify-center px-4">
|
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 flex items-center justify-center px-4">
|
||||||
<div className="absolute inset-0 w-full h-full bg-background z-10 [mask-image:radial-gradient(transparent,white)] pointer-events-none" />
|
|
||||||
<Boxes />
|
|
||||||
|
|
||||||
<Link to="/" className="absolute top-4 left-4 z-30">
|
<Link to="/" className="absolute top-4 left-4 z-30">
|
||||||
<Button variant="ghost" size="sm" className="text-primary-foreground hover:bg-primary-foreground/10">
|
<Button variant="ghost" size="sm" className="text-primary hover:bg-primary/10">
|
||||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||||
Voltar
|
Voltar
|
||||||
</Button>
|
</Button>
|
||||||
@ -68,20 +65,17 @@ const Auth = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen relative w-full overflow-hidden bg-gradient-primary flex items-center justify-center px-4">
|
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 flex items-center justify-center px-4">
|
||||||
<div className="absolute inset-0 w-full h-full bg-background z-10 [mask-image:radial-gradient(transparent,white)] pointer-events-none" />
|
|
||||||
|
|
||||||
<Boxes />
|
|
||||||
|
|
||||||
{/* Botão para voltar à landing page */}
|
{/* Botão para voltar à landing page */}
|
||||||
<Link to="/" className="absolute top-4 left-4 z-30">
|
<Link to="/" className="absolute top-4 left-4 z-30">
|
||||||
<Button variant="ghost" size="sm" className="text-primary-foreground hover:bg-primary-foreground/10">
|
<Button variant="ghost" size="sm" className="text-primary hover:bg-primary/10">
|
||||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||||
Voltar
|
Voltar
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Card className="w-full max-w-md relative z-20 glass-card">
|
<Card className="w-full max-w-md glass-card bg-white/95 backdrop-blur-sm border-white/20 shadow-xl">
|
||||||
<CardHeader className="space-y-1 text-center">
|
<CardHeader className="space-y-1 text-center">
|
||||||
<div className="flex items-center justify-center space-x-2 mb-4">
|
<div className="flex items-center justify-center space-x-2 mb-4">
|
||||||
<img
|
<img
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user