Skip to content

Commit 16e36ca

Browse files
Merge pull request #89 from Rohanrathod7/feature-password-reset
Feat :Feature password reset(Create Forgot Password Page & Integrate Password Reset Flow)[Issue #58]
2 parents f284413 + 7e8999e commit 16e36ca

3 files changed

Lines changed: 247 additions & 67 deletions

File tree

4.57 MB
Loading

LocalMind-Frontend/src/features/Auth/ForgotPassword.tsx

Lines changed: 62 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useState } from 'react'
22
import { Link } from 'react-router-dom'
3-
import Input from '../../shared/component/v1/Input'
43
import { forgotPassword } from '../../services/auth.service'
54
import robotImage from '../../assets/forgot-password-robot.png'
65

@@ -35,21 +34,31 @@ export default function ForgotPassword() {
3534
}
3635
}
3736

37+
// Extracted styles
38+
const glowStyles = `
39+
@keyframes glow {
40+
0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)); }
41+
50% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)); }
42+
}
43+
.logo-glow {
44+
animation: glow 3s ease-in-out infinite;
45+
}
46+
`
47+
3848
return (
39-
<div className="min-h-screen bg-[#0a0a0a] flex">
40-
{/* Left Side - Robot Image (Hidden on mobile) */}
41-
<div className="hidden lg:flex lg:w-1/2 items-center justify-center bg-gradient-to-br from-gray-400 to-gray-600">
42-
<img src={robotImage} alt="AI Robot" className="w-full h-full object-cover" />
43-
</div>
49+
<div className="min-h-screen bg-[#292828] flex flex-col items-center justify-center p-3 sm:p-4 md:p-6 pt-14 sm:pt-16 md:pt-20">
50+
<style>{glowStyles}</style>
4451

45-
{/* Right Side - Form */}
46-
<div className="w-full lg:w-1/2 flex items-center justify-center px-8 py-12">
47-
<div className="w-full max-w-md">
48-
{/* Header */}
49-
<div className="mb-8">
50-
<h1 className="text-3xl font-bold text-white mb-2">Forgot Password?</h1>
51-
<p className="text-gray-400">Enter your email to reset your password.</p>
52-
</div>
52+
{/* Card Container */}
53+
<div className="w-full max-w-7xl bg-[#181818] rounded-3xl shadow-2xl overflow-hidden grid grid-cols-1 md:grid-cols-2">
54+
{/* Left Section - Form */}
55+
<div className="bg-[#181818] p-6 sm:p-8 md:p-12 lg:p-16 xl:p-20 flex flex-col justify-center">
56+
<h1 className="text-2xl sm:text-3xl md:text-4xl font-bold text-white mb-2">
57+
Forgot Password?
58+
</h1>
59+
<p className="text-gray-400 text-xs sm:text-sm md:text-base mb-6 md:mb-8">
60+
Enter your email to reset your password.
61+
</p>
5362

5463
{/* Feedback Messages */}
5564
{apiError && (
@@ -63,35 +72,61 @@ export default function ForgotPassword() {
6372
</div>
6473
)}
6574

66-
{/* Form */}
67-
<form onSubmit={handleSubmit} className="space-y-6">
68-
<Input
69-
label="Email Address"
70-
type="email"
71-
placeholder="Enter your email"
72-
value={email}
73-
onChange={e => setEmail(e.target.value)}
74-
disabled={loading}
75-
/>
75+
<form onSubmit={handleSubmit} className="space-y-4">
76+
<div className="flex flex-col gap-1.5 relative mb-6">
77+
<label className="text-gray-200 text-xs sm:text-sm font-semibold">
78+
Email Address
79+
</label>
80+
<input
81+
type="email"
82+
placeholder="Enter your email"
83+
value={email}
84+
onChange={e => setEmail(e.target.value)}
85+
disabled={loading}
86+
className="w-full px-4 py-2.5 bg-[#2a2a2a] border border-gray-600 rounded-lg text-sm sm:text-base text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:border-transparent transition"
87+
/>
88+
</div>
7689

7790
<button
7891
type="submit"
7992
disabled={loading}
80-
className="w-full py-3 rounded-lg bg-[#2a2a2a] hover:bg-[#3a3a3a] text-white font-medium transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"
93+
className="w-full bg-white hover:bg-gray-200 text-black font-bold py-2.5 text-sm sm:text-base rounded-lg transition-colors duration-200 mt-2 flex items-center justify-center gap-2"
8194
>
95+
{loading && (
96+
<svg className="animate-spin h-5 w-5" fill="none" viewBox="0 0 24 24">
97+
<circle
98+
className="opacity-25"
99+
cx="12"
100+
cy="12"
101+
r="10"
102+
stroke="currentColor"
103+
strokeWidth="4"
104+
/>
105+
<path
106+
className="opacity-75"
107+
fill="currentColor"
108+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
109+
/>
110+
</svg>
111+
)}
82112
{loading ? 'Sending...' : 'Send Reset Link'}
83113
</button>
84114

85-
<div className="text-center">
115+
<div className="text-center mt-6">
86116
<Link
87117
to="/login"
88-
className="text-sm text-gray-400 hover:text-white transition-colors"
118+
className="text-gray-400 hover:text-white hover:underline transition-all duration-200 text-sm"
89119
>
90120
&larr; Back to Login
91121
</Link>
92122
</div>
93123
</form>
94124
</div>
125+
126+
{/* Right Side - Robot Image */}
127+
<div className="bg-gradient-to-br from-gray-700 to-gray-900 hidden md:flex items-center justify-center overflow-hidden">
128+
<img src={robotImage} alt="AI Robot" className="w-full h-full object-cover" />
129+
</div>
95130
</div>
96131
</div>
97132
)

0 commit comments

Comments
 (0)