[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
|
<div
|
||||||
className="form-group"
|
className="form-group"
|
||||||
>
|
>
|
||||||
<LocalizedInput
|
<input
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
className="form-control"
|
className="form-control"
|
||||||
id="resetPasswordInput"
|
id="resetPasswordInput"
|
||||||
name="password"
|
name="password"
|
||||||
placeholder={
|
placeholder="Password"
|
||||||
Object {
|
|
||||||
"defaultMessage": "Password",
|
|
||||||
"id": "password_form.pwd",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
type="password"
|
type="password"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -3,15 +3,12 @@
|
|||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, {useState, useRef, memo} from 'react';
|
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 {useHistory} from 'react-router-dom';
|
||||||
|
|
||||||
import type {ServerError} from '@mattermost/types/errors';
|
import type {ServerError} from '@mattermost/types/errors';
|
||||||
|
|
||||||
import LocalizedInput from 'components/localized_input/localized_input';
|
|
||||||
|
|
||||||
import Constants from 'utils/constants';
|
import Constants from 'utils/constants';
|
||||||
import {t} from 'utils/i18n';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
location: {search: string};
|
location: {search: string};
|
||||||
@@ -22,6 +19,8 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PasswordResetForm = ({location, siteName, actions}: Props) => {
|
const PasswordResetForm = ({location, siteName, actions}: Props) => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const [error, setError] = useState<React.ReactNode>(null);
|
const [error, setError] = useState<React.ReactNode>(null);
|
||||||
@@ -67,19 +66,20 @@ const PasswordResetForm = ({location, siteName, actions}: Props) => {
|
|||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='password_form.enter'
|
id='password_form.enter'
|
||||||
defaultMessage='Enter a new password for your {siteName} account.'
|
defaultMessage='Enter a new password for your {siteName} account.'
|
||||||
values={{
|
values={{siteName}}
|
||||||
siteName,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<div className={classNames('form-group', {'has-error': error})}>
|
<div className={classNames('form-group', {'has-error': error})}>
|
||||||
<LocalizedInput
|
<input
|
||||||
id='resetPasswordInput'
|
id='resetPasswordInput'
|
||||||
type='password'
|
type='password'
|
||||||
className='form-control'
|
className='form-control'
|
||||||
name='password'
|
name='password'
|
||||||
ref={passwordInput}
|
ref={passwordInput}
|
||||||
placeholder={{id: t('password_form.pwd'), defaultMessage: 'Password'}}
|
placeholder={intl.formatMessage({
|
||||||
|
id: 'password_form.pwd',
|
||||||
|
defaultMessage: 'Password',
|
||||||
|
})}
|
||||||
spellCheck='false'
|
spellCheck='false'
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user