[MM-54833] Convert LocalizedInput of 'password_reset_form.tsx' to regular input component (#24839)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4f279a1dd9
Коммит
8ae1cb2c37
@@ -29,17 +29,12 @@ exports[`components/PasswordResetForm should match snapshot 1`] = `
|
||||
<div
|
||||
className="form-group"
|
||||
>
|
||||
<LocalizedInput
|
||||
<input
|
||||
autoFocus={true}
|
||||
className="form-control"
|
||||
id="resetPasswordInput"
|
||||
name="password"
|
||||
placeholder={
|
||||
Object {
|
||||
"defaultMessage": "Password",
|
||||
"id": "password_form.pwd",
|
||||
}
|
||||
}
|
||||
placeholder="Password"
|
||||
spellCheck="false"
|
||||
type="password"
|
||||
/>
|
||||
|
||||
@@ -3,15 +3,12 @@
|
||||
|
||||
import classNames from 'classnames';
|
||||
import React, {useState, useRef, memo} from 'react';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
import {FormattedMessage, useIntl} from 'react-intl';
|
||||
import {useHistory} from 'react-router-dom';
|
||||
|
||||
import type {ServerError} from '@mattermost/types/errors';
|
||||
|
||||
import LocalizedInput from 'components/localized_input/localized_input';
|
||||
|
||||
import Constants from 'utils/constants';
|
||||
import {t} from 'utils/i18n';
|
||||
|
||||
interface Props {
|
||||
location: {search: string};
|
||||
@@ -22,6 +19,8 @@ interface Props {
|
||||
}
|
||||
|
||||
const PasswordResetForm = ({location, siteName, actions}: Props) => {
|
||||
const intl = useIntl();
|
||||
|
||||
const history = useHistory();
|
||||
|
||||
const [error, setError] = useState<React.ReactNode>(null);
|
||||
@@ -67,19 +66,20 @@ const PasswordResetForm = ({location, siteName, actions}: Props) => {
|
||||
<FormattedMessage
|
||||
id='password_form.enter'
|
||||
defaultMessage='Enter a new password for your {siteName} account.'
|
||||
values={{
|
||||
siteName,
|
||||
}}
|
||||
values={{siteName}}
|
||||
/>
|
||||
</p>
|
||||
<div className={classNames('form-group', {'has-error': error})}>
|
||||
<LocalizedInput
|
||||
<input
|
||||
id='resetPasswordInput'
|
||||
type='password'
|
||||
className='form-control'
|
||||
name='password'
|
||||
ref={passwordInput}
|
||||
placeholder={{id: t('password_form.pwd'), defaultMessage: 'Password'}}
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'password_form.pwd',
|
||||
defaultMessage: 'Password',
|
||||
})}
|
||||
spellCheck='false'
|
||||
autoFocus={true}
|
||||
/>
|
||||
|
||||
Ссылка в новой задаче
Block a user