@@ -5,6 +5,7 @@ import PrimaryButton from '@/Components/PrimaryButton';
5
5
import TextInput from '@/Components/TextInput' ;
6
6
import { useForm } from '@inertiajs/react' ;
7
7
import { Transition } from '@headlessui/react' ;
8
+ import { InputText } from "primereact/inputtext" ;
8
9
9
10
export default function UpdatePasswordForm ( { className = '' } ) {
10
11
const passwordInput = useRef ( ) ;
@@ -22,17 +23,17 @@ export default function UpdatePasswordForm({ className = '' }) {
22
23
put ( route ( 'password.update' ) , {
23
24
preserveScroll : true ,
24
25
onSuccess : ( ) => reset ( ) ,
25
- onError : ( errors ) => {
26
- if ( errors . password ) {
27
- reset ( 'password' , 'password_confirmation' ) ;
28
- passwordInput . current . focus ( ) ;
29
- }
30
-
31
- if ( errors . current_password ) {
32
- reset ( 'current_password' ) ;
33
- currentPasswordInput . current . focus ( ) ;
34
- }
35
- } ,
26
+ // onError: (errors) => {
27
+ // if (errors.password) {
28
+ // reset('password', 'password_confirmation');
29
+ // passwordInput.current.focus();
30
+ // }
31
+ //
32
+ // if (errors.current_password) {
33
+ // reset('current_password');
34
+ // currentPasswordInput.current.focus();
35
+ // }
36
+ // },
36
37
} ) ;
37
38
} ;
38
39
@@ -46,52 +47,47 @@ export default function UpdatePasswordForm({ className = '' }) {
46
47
</ p >
47
48
</ header >
48
49
49
- < form onSubmit = { updatePassword } className = "mt-6 space-y-6" >
50
- < div >
51
- < InputLabel htmlFor = "current_password" value = "Current Password" />
52
-
53
- < TextInput
50
+ < form onSubmit = { updatePassword } className = "mt-4 space-y-6" >
51
+ < div className = "mb-3" >
52
+ < label htmlFor = "current_password" className = "block text-900 font-medium mb-2" > Current Password</ label >
53
+ < InputText
54
54
id = "current_password"
55
- ref = { currentPasswordInput }
55
+ type = "password"
56
+ placeholder = "Current Password"
57
+ className = "w-full"
56
58
value = { data . current_password }
57
59
onChange = { ( e ) => setData ( 'current_password' , e . target . value ) }
58
- type = "password"
59
- className = "mt-1 block w-full"
60
- autoComplete = "current-password"
61
60
/>
62
-
63
- < InputError message = { errors . current_password } className = "mt-2" />
61
+ < InputError message = { errors . current_password } />
64
62
</ div >
65
63
66
- < div >
64
+ < div className = "mb-3" >
67
65
< InputLabel htmlFor = "password" value = "New Password" />
68
-
69
- < TextInput
66
+ < InputText
70
67
id = "password"
71
68
ref = { passwordInput }
69
+ type = "password"
70
+ placeholder = "Password"
71
+ className = "w-full"
72
72
value = { data . password }
73
73
onChange = { ( e ) => setData ( 'password' , e . target . value ) }
74
- type = "password"
75
- className = "mt-1 block w-full"
76
- autoComplete = "new-password"
77
74
/>
78
-
79
- < InputError message = { errors . password } className = "mt-2" />
75
+ < InputError message = { errors . password } />
80
76
</ div >
81
77
82
- < div >
78
+ < div className = "mb-3" >
83
79
< InputLabel htmlFor = "password_confirmation" value = "Confirm Password" />
84
80
85
- < TextInput
81
+ < InputText
86
82
id = "password_confirmation"
83
+ type = "password"
84
+ placeholder = "Confirm Password"
85
+ className = "w-full"
87
86
value = { data . password_confirmation }
88
87
onChange = { ( e ) => setData ( 'password_confirmation' , e . target . value ) }
89
- type = "password"
90
- className = "mt-1 block w-full"
91
- autoComplete = "new-password"
92
88
/>
93
89
94
- < InputError message = { errors . password_confirmation } className = "mt-2" />
90
+ < InputError message = { errors . password_confirmation } />
95
91
</ div >
96
92
97
93
< div className = "flex items-center gap-4" >
0 commit comments