mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
minor changes
This commit is contained in:
parent
f258ab4a97
commit
8c60b7e7ce
Binary file not shown.
BIN
rsconcept/frontend/public/DejaVu_min.ttf
Normal file
BIN
rsconcept/frontend/public/DejaVu_min.ttf
Normal file
Binary file not shown.
|
@ -82,6 +82,13 @@
|
|||
@apply text-white bg-blue-400 hover:bg-blue-600 dark:bg-orange-600 dark:hover:bg-orange-400 disabled:bg-gray-400 dark:disabled:bg-gray-600
|
||||
}
|
||||
|
||||
.clr-btn-green {
|
||||
@apply text-white bg-green-400 hover:bg-green-600 dark:bg-green-600 dark:hover:bg-green-400 dark:text-black disabled:bg-gray-400 dark:disabled:bg-gray-600
|
||||
}
|
||||
|
||||
.clr-btn-blue {
|
||||
@apply text-white bg-blue-400 hover:bg-blue-600 dark:bg-blue-600 dark:hover:bg-blue-400 dark:text-black disabled:bg-gray-400 dark:disabled:bg-gray-600
|
||||
}
|
||||
.clr-btn-default {
|
||||
@apply text-gray-600 dark:text-zinc-200 dark:disabled:text-zinc-400 disabled:text-gray-400 bg-[#f0f2f7] hover:bg-gray-300 dark:bg-gray-600 dark:hover:bg-gray-400
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ export function ChangePassword() {
|
|||
const navigate = useNavigate();
|
||||
|
||||
const colorClass = useMemo(() => {
|
||||
return !!newPassword && !!newPasswordRepeat && newPassword !== newPasswordRepeat ? 'bg-red-500' : '';
|
||||
return !!newPassword && !!newPasswordRepeat && newPassword !== newPasswordRepeat ? 'bg-red-500' : 'clr-input';
|
||||
}, [newPassword, newPasswordRepeat]);
|
||||
|
||||
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
||||
|
@ -35,39 +35,41 @@ export function ChangePassword() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className='flex-grow max-w-sm px-4'>
|
||||
<form onSubmit={handleSubmit} className='flex-grow min-h-full px-6 py-2 border min-w-fit bg-slate-200'>
|
||||
<TextInput id='old_password'
|
||||
type='password'
|
||||
label='Введите старый пароль:'
|
||||
value={oldPassword}
|
||||
onChange={event => setOldPassword(event.target.value)}
|
||||
/>
|
||||
<TextInput id='new_password'
|
||||
colorClass={colorClass}
|
||||
label="Введите новый пароль:"
|
||||
value={newPassword}
|
||||
onChange={event => {
|
||||
setNewPassword(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<TextInput id='new_password_repeat'
|
||||
colorClass={colorClass}
|
||||
label="Повторите новый пароль:"
|
||||
value={newPasswordRepeat}
|
||||
onChange={event => {
|
||||
setNewPasswordRepeat(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<div className='relative flex justify-center my-4 border'>
|
||||
<div className='flex max-w-sm px-4 border-l-2'>
|
||||
<form onSubmit={handleSubmit} className='flex flex-col justify-between px-6 min-w-fit '>
|
||||
<div>
|
||||
<TextInput id='old_password'
|
||||
type='password'
|
||||
label='Введите старый пароль:'
|
||||
value={oldPassword}
|
||||
onChange={event => setOldPassword(event.target.value)}
|
||||
/>
|
||||
<TextInput id='new_password'
|
||||
colorClass={colorClass}
|
||||
label="Введите новый пароль:"
|
||||
value={newPassword}
|
||||
onChange={event => {
|
||||
setNewPassword(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<TextInput id='new_password_repeat'
|
||||
colorClass={colorClass}
|
||||
label="Повторите новый пароль:"
|
||||
value={newPasswordRepeat}
|
||||
onChange={event => {
|
||||
setNewPasswordRepeat(event.target.value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{ error && <BackendError error={error} />}
|
||||
<div className='flex justify-center py-4'>
|
||||
<button
|
||||
type='submit'
|
||||
className='absolute bottom-0 px-2 py-1 bg-blue-500 border'
|
||||
className={`px-2 py-1 border clr-btn-blue`}
|
||||
disabled={loading}>
|
||||
<span>Сменить пароль</span>
|
||||
</button>
|
||||
</div>
|
||||
{ error && <BackendError error={error} />}
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
@ -15,10 +15,6 @@ export function UserProfile() {
|
|||
const [first_name, setFirstName] = useState('');
|
||||
const [last_name, setLastName] = useState('');
|
||||
|
||||
|
||||
// const [showChangePassword, setShowChangePassword] = useState(false);
|
||||
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (user) {
|
||||
setUsername(user.username);
|
||||
|
@ -40,34 +36,39 @@ export function UserProfile() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div><h1 className='flex justify-center py-2'> Учетные данные пользователя </h1>
|
||||
<div className='flex flex-row justify-center py-2'>
|
||||
<div className='flex-grow max-w-sm px-4 '>
|
||||
<form onSubmit={handleSubmit} className='flex-grow px-6 py-2 border center min-w-fit'>
|
||||
<TextInput id='username'
|
||||
label='Логин:'
|
||||
value={username}
|
||||
onChange={event => setUsername(event.target.value)}
|
||||
/>
|
||||
<TextInput id='first_name'
|
||||
label="Имя:"
|
||||
value={first_name}
|
||||
onChange={event => setFirstName(event.target.value)}
|
||||
/>
|
||||
<TextInput id='last_name' label="Фамилия:" value={last_name} onChange={event => setLastName(event.target.value)}/>
|
||||
<TextInput id='email' label="Электронная почта:" value={email} onChange={event => setEmail(event.target.value)}/>
|
||||
<div className='flex items-center justify-center my-4'>
|
||||
<button
|
||||
type='submit'
|
||||
className='px-2 py-1 bg-green-500 border center'
|
||||
disabled={processing}>
|
||||
<span>Сохранить мои данные</span>
|
||||
</button>
|
||||
</div>
|
||||
<div className='flex justify-center'>
|
||||
<div className='place-self-center'>
|
||||
<h1 className='flex justify-center py-2'> Учетные данные пользователя </h1>
|
||||
<div className='flex justify-center px-6 py-2 max-w-fit'>
|
||||
<div className='flex max-w-sm px-4'>
|
||||
<form onSubmit={handleSubmit} className='px-6 min-w-fit'>
|
||||
<div>
|
||||
<TextInput id='username'
|
||||
label='Логин:'
|
||||
value={username}
|
||||
onChange={event => setUsername(event.target.value)}
|
||||
/>
|
||||
<TextInput id='first_name'
|
||||
label="Имя:"
|
||||
value={first_name}
|
||||
onChange={event => setFirstName(event.target.value)}
|
||||
/>
|
||||
<TextInput id='last_name' label="Фамилия:" value={last_name} onChange={event => setLastName(event.target.value)}/>
|
||||
<TextInput id='email' label="Электронная почта:" value={email} onChange={event => setEmail(event.target.value)}/>
|
||||
</div>
|
||||
<div className='flex justify-center px-0 py-4'>
|
||||
<button
|
||||
type='submit'
|
||||
className={`px-2 py-1 border clr-btn-green`}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<ChangePassword />
|
||||
</div>
|
||||
disabled={processing}>
|
||||
<span>Сохранить мои данные</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<ChangePassword />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
@ -24,7 +24,7 @@ export const urls = {
|
|||
};
|
||||
|
||||
export const resources = {
|
||||
graph_font: '/DejaVu.ttf'
|
||||
graph_font: '/DejaVu_min.ttf'
|
||||
}
|
||||
|
||||
export const prefixes = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user