Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions frontend/src/components/register/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ function Register() {
const [submitting, setSubmitting] = useState(false);
const [verifying, setVerifying] = useState(false);
const [showPassword, setShowPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);


const months = [
"January", "February", "March", "April", "May", "June",
Expand Down Expand Up @@ -455,16 +457,32 @@ function Register() {
<div>
<Label>Confirm Password</Label>
<div className="space-y-1.5">
<StyledInput
name="confirm_password"
type="password"
autoComplete="new-password"
value={user_values.confirm_password}
onChange={handle_user_values}
required
disabled={submitting || verifying}
placeholder="Confirm your password"
/>
<div className="relative">
<StyledInput
name="confirm_password"
type={showConfirmPassword ? "text" : "password"}
autoComplete="new-password"
value={user_values.confirm_password}
onChange={handle_user_values}
required
disabled={submitting || verifying}
placeholder="Confirm your password"
/>
<button
type="button"
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2"
style={{ cursor: "pointer" }}
aria-label={showConfirmPassword ? "Hide confirm password" : "Show confirm password"}
>
{showConfirmPassword ? (
<FiEyeOff size={14} style={{ color: "var(--text-secondary)" }} />
) : (
<FiEye size={14} style={{ color: "var(--text-secondary)" }} />
)}
</button>
</div>

<AnimatePresence>
{password_validation && (
<motion.div
Expand All @@ -485,6 +503,7 @@ function Register() {
</div>
</div>


{/* Date of Birth */}
<div
className="rounded-2xl p-3"
Expand Down