feat: add reusable PasswordInput with show/hide toggle
Replaces all type="password" inputs site-wide with a PasswordInput component that includes an eye icon toggle for visibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'
|
||||
import { useAuthStore } from '@/store/authStore'
|
||||
import { authApi } from '@/api/auth'
|
||||
import { toast } from '@/lib/toast'
|
||||
import { PasswordInput } from '@/components/common/PasswordInput'
|
||||
import { BrandLogo } from '@/components/common/BrandLogo'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
@@ -87,9 +88,8 @@ export function ChangePasswordPage() {
|
||||
<label htmlFor="current-password" className="mb-1 block text-sm font-medium text-white">
|
||||
Current Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="current-password"
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
value={currentPassword}
|
||||
@@ -107,9 +107,8 @@ export function ChangePasswordPage() {
|
||||
<label htmlFor="new-password" className="mb-1 block text-sm font-medium text-white">
|
||||
New Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="new-password"
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
value={newPassword}
|
||||
@@ -131,9 +130,8 @@ export function ChangePasswordPage() {
|
||||
<label htmlFor="confirm-password" className="mb-1 block text-sm font-medium text-white">
|
||||
Confirm New Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="confirm-password"
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
value={confirmPassword}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState } from 'react'
|
||||
import { Link, useNavigate, useLocation } from 'react-router-dom'
|
||||
import { useAuthStore } from '@/store/authStore'
|
||||
import { BrandLogo } from '@/components/common/BrandLogo'
|
||||
import { PasswordInput } from '@/components/common/PasswordInput'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export function LoginPage() {
|
||||
@@ -95,10 +96,9 @@ export function LoginPage() {
|
||||
<label htmlFor="password" className="mb-1 block text-sm font-medium text-white">
|
||||
Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
value={password}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Link, useNavigate } from 'react-router-dom'
|
||||
import { useAuthStore } from '@/store/authStore'
|
||||
import { inviteApi } from '@/api/invite'
|
||||
import { BrandLogo } from '@/components/common/BrandLogo'
|
||||
import { PasswordInput } from '@/components/common/PasswordInput'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export function RegisterPage() {
|
||||
@@ -187,10 +188,9 @@ export function RegisterPage() {
|
||||
<label htmlFor="password" className="block text-sm font-medium text-white">
|
||||
Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
value={password}
|
||||
@@ -211,10 +211,9 @@ export function RegisterPage() {
|
||||
<label htmlFor="confirmPassword" className="block text-sm font-medium text-white">
|
||||
Confirm password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
value={confirmPassword}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Link, useSearchParams, useNavigate } from 'react-router-dom'
|
||||
import { authApi } from '@/api/auth'
|
||||
import { toast } from '@/lib/toast'
|
||||
import { BrandLogo } from '@/components/common/BrandLogo'
|
||||
import { PasswordInput } from '@/components/common/PasswordInput'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export function ResetPasswordPage() {
|
||||
@@ -123,9 +124,8 @@ export function ResetPasswordPage() {
|
||||
<label htmlFor="new-password" className="mb-1 block text-sm font-medium text-white">
|
||||
New Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="new-password"
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
value={newPassword}
|
||||
@@ -147,9 +147,8 @@ export function ResetPasswordPage() {
|
||||
<label htmlFor="confirm-password" className="mb-1 block text-sm font-medium text-white">
|
||||
Confirm New Password
|
||||
</label>
|
||||
<input
|
||||
<PasswordInput
|
||||
id="confirm-password"
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
value={confirmPassword}
|
||||
|
||||
Reference in New Issue
Block a user