Fix build

This commit is contained in:
IRBorisov 2023-08-11 11:05:22 +03:00
parent cffcfc88b8
commit 01fe367845
2 changed files with 12 additions and 8 deletions

View File

@ -16,8 +16,6 @@ export function ChangePassword() {
const [password_equal, setPasswordEqual] = useState(true);
const navigate = useNavigate();
const input_class: string = `flex-grow max-w-xl px-3 py-2 border center min-w-full ${password_equal ? "" : "text-red-500"}`
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
if (new_password !== new_password_repeat) {
@ -40,19 +38,25 @@ export function ChangePassword() {
type='password'
label='Введите старый пароль:'
value={old_password}
onChange={event => (setOldPassword(event.target.value))}
onChange={event => setOldPassword(event.target.value)}
/>
<TextInput id='new_password'
//className={input_class}
colorClass={`${password_equal ? "" : "text-red-500"}`}
label="Введите новый пароль:"
value={new_password}
onChange={event => (setNewPassword(event.target.value), setPasswordEqual(true))}
onChange={event => {
setNewPassword(event.target.value);
setPasswordEqual(true);
}}
/>
<TextInput id='new_password'
//className={input_class}
colorClass={`${password_equal ? "" : "text-red-500"}`}
label="Повторите новый пароль:"
value={new_password_repeat}
onChange={event => (setNewPasswordRepeat(event.target.value), setPasswordEqual(true))}
onChange={event => {
setNewPasswordRepeat(event.target.value);
setPasswordEqual(true);
}}
/>
<div className='relative flex justify-center my-4 border'>
<button

View File

@ -8,7 +8,7 @@ import { ChangePassword } from './ChangePassword';
export function UserProfile() {
const { updateUser, user, processing, error } = useUserProfile();
const { updateUser, user, processing } = useUserProfile();
const [username, setUsername] = useState('');
const [email, setEmail] = useState('');