<commit_before>import PropTypes from 'prop-types'
import React from 'react'
import {FormattedMessage, intlShape} from 'react-intl'
import {
  ButtonGroup,
  StatedValue,
  Typography
} from 'tocco-ui'

import {
  StyledLoginFormInput,
  StyledLoginFormInputWrapper,
  StyledLoginFormWrapper,
  StyledTransparentButton,
  StyledLoginButton
} from '../StyledLoginForm'
import {Pages} from '../../types/Pages'

export class PasswordRequest extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      username: this.props.username || ''
    }
  }

  handleSubmit(e) {
    e.preventDefault()
    this.props.requestPassword(this.state.username)
  }

  handleUsernameChange(e) {
    this.setState({
      username: e.target.value
    })
  }

  render() {
    return (
      <StyledLoginFormWrapper>
        {this.props.showTitle
          && <Typography.H5><FormattedMessage id="client.login.passwordRequest.title"/></Typography.H5>}
        <Typography.P><FormattedMessage id="client.login.passwordRequest.introduction"/></Typography.P>
        <form onSubmit={this.handleSubmit.bind(this)}>
          <StatedValue
            hasValue={!!this.state.username}
            id="login-username"
            label={this.msg('client.login.form.userPlaceholder')}
          >
            <StyledLoginFormInputWrapper>
              <StyledLoginFormInput
                name="user"
                onChange={this.handleUsernameChange.bind(this)}
                required
                type="text"
                value={this.state.username}
                data-cy="password-request_input"
              />
            </StyledLoginFormInputWrapper>
          </StatedValue>

          <ButtonGroup look="raised">
            <StyledLoginButton
              disabled={!this.state.username || this.props.pending}<commit_msg>refactor(login): set reset button as raised<commit_after>import PropTypes from 'prop-types'
import React from 'react'
import {FormattedMessage, intlShape} from 'react-intl'
import {
  ButtonGroup,
  StatedValue,
  Typography
} from 'tocco-ui'

import {
  StyledLoginFormInput,
  StyledLoginFormInputWrapper,
  StyledLoginFormWrapper,
  StyledTransparentButton,
  StyledLoginButton
} from '../StyledLoginForm'
import {Pages} from '../../types/Pages'

export class PasswordRequest extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      username: this.props.username || ''
    }
  }

  handleSubmit(e) {
    e.preventDefault()
    this.props.requestPassword(this.state.username)
  }

  handleUsernameChange(e) {
    this.setState({
      username: e.target.value
    })
  }

  render() {
    return (
      <StyledLoginFormWrapper>
        {this.props.showTitle
          && <Typography.H5><FormattedMessage id="client.login.passwordRequest.title"/></Typography.H5>}
        <Typography.P><FormattedMessage id="client.login.passwordRequest.introduction"/></Typography.P>
        <form onSubmit={this.handleSubmit.bind(this)}>
          <StatedValue
            hasValue={!!this.state.username}
            id="login-username"
            label={this.msg('client.login.form.userPlaceholder')}
          >
            <StyledLoginFormInputWrapper>
              <StyledLoginFormInput
                name="user"
                onChange={this.handleUsernameChange.bind(this)}
                required
                type="text"
                value={this.state.username}
                data-cy="password-request_input"
              />
            </StyledLoginFormInputWrapper>
          </StatedValue>

          <ButtonGroup look="raised">
            <StyledLoginButton
              look="raised"
              disabled={!this.state.username || this.props.pending}
{'fraction_non_alphanumeric': 0.11579509071504802, 'fraction_numerical': 0.0010672358591248667, 'mean_word_length': 2.455299539170507, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5935746', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1054, 'n_words': 159}