<commit_before>import React, { Component } from 'react';
import { Message } from 'retranslate';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { Shimmer } from '../../common/shimmer/Shimmer';

export class GreetingBar extends Component {
  componentDidMount() {}

  render() {
    const { user } = this.props;
    if (!user) {
      return (
        <div className="col mb-1 mt-2">
          <Shimmer height={38} />
        </div>
      );
    }
    return (
      <>
        <div className="col-md-auto mb-1 mt-2 lead">
          <Message>account.greeting</Message>, {user.firstName} {user.lastName}!
        </div>
        <div className="col mb-1 mt-2 text-md-right">
          {user.email}
          {user.email && user.phoneNumber && <span className="mx-1"> · </span>}
          <span className="mr-2">{user.phoneNumber} </span>
          <Link className="btn btn-light" to="/contact-details">
            <Message>account.update.contact</Message>
          </Link>
        </div>
      </>
    );
  }
}

const mapStateToProps = (state) => ({
  user: state.login.user,
});

const withRedux = connect(mapStateToProps);

export default withRedux(GreetingBar);<commit_msg>Convert greeting bar to react-intl<commit_after>import React, { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { Shimmer } from '../../common/shimmer/Shimmer';

export class GreetingBar extends Component {
  componentDidMount() {}

  render() {
    const { user } = this.props;
    if (!user) {
      return (
        <div className="col mb-1 mt-2">
          <Shimmer height={38} />
        </div>
      );
    }
    return (
      <>
        <div className="col-md-auto mb-1 mt-2 lead">
          <FormattedMessage id="account.greeting" />, {user.firstName} {user.lastName}!
        </div>
        <div className="col mb-1 mt-2 text-md-right">
          {user.email}
          {user.email && user.phoneNumber && <span className="mx-1"> · </span>}
          <span className="mr-2">{user.phoneNumber} </span>
          <Link className="btn btn-light" to="/contact-details">
            <FormattedMessage id="account.update.contact" />
          </Link>
        </div>
      </>
    );
  }
}

const mapStateToProps = (state) => ({
  user: state.login.user,
});

const withRedux = connect(mapStateToProps);

export default withRedux(GreetingBar);
{'fraction_non_alphanumeric': 0.16349656009712668, 'fraction_numerical': 0.008093889113719142, 'mean_word_length': 2.4573426573426573, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, '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': '408762', 'n_tokens_mistral': 778, 'n_tokens_neox': 778, 'n_words': 173}