<commit_before>// @flow

import { HeaderTitle } from '@react-navigation/stack';
import PropTypes from 'prop-types';
import * as React from 'react';
import { View, Platform } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';

import { threadIsPersonalAndPending } from 'lib/shared/thread-utils';
import type { ThreadInfo } from 'lib/types/thread-types';
import { threadInfoPropType } from 'lib/types/thread-types';
import { connect } from 'lib/utils/redux-utils';

import Button from '../components/button.react';
import { ThreadSettingsRouteName } from '../navigation/route-names';
import type { AppState } from '../redux/redux-setup';
import { styleSelector } from '../themes/colors';
import type { ChatNavigationProp } from './chat.react';

type Props = {|
  threadInfo: ThreadInfo,
  navigate: $PropertyType<ChatNavigationProp<'MessageList'>, 'navigate'>,
  // Redux state
  styles: typeof styles,
|};
class MessageListHeaderTitle extends React.PureComponent<Props> {
  static propTypes = {
    threadInfo: threadInfoPropType.isRequired,
    navigate: PropTypes.func.isRequired,
    styles: PropTypes.objectOf(PropTypes.object).isRequired,
  };

  render() {
    let icon, fakeIcon;
    const areSettingsDisabled = threadIsPersonalAndPending(
      this.props.threadInfo,
    );
    if (Platform.OS === 'ios' && !areSettingsDisabled) {
      icon = (
        <Icon
          name="ios-arrow-forward"
          size={20}
          style={this.props.styles.forwardIcon}
        />
      );
      fakeIcon = (<commit_msg>[native] Block setting for all the pending threads<commit_after>// @flow

import { HeaderTitle } from '@react-navigation/stack';
import PropTypes from 'prop-types';
import * as React from 'react';
import { View, Platform } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';

import { threadIsPending } from 'lib/shared/thread-utils';
import type { ThreadInfo } from 'lib/types/thread-types';
import { threadInfoPropType } from 'lib/types/thread-types';
import { connect } from 'lib/utils/redux-utils';

import Button from '../components/button.react';
import { ThreadSettingsRouteName } from '../navigation/route-names';
import type { AppState } from '../redux/redux-setup';
import { styleSelector } from '../themes/colors';
import type { ChatNavigationProp } from './chat.react';

type Props = {|
  threadInfo: ThreadInfo,
  navigate: $PropertyType<ChatNavigationProp<'MessageList'>, 'navigate'>,
  // Redux state
  styles: typeof styles,
|};
class MessageListHeaderTitle extends React.PureComponent<Props> {
  static propTypes = {
    threadInfo: threadInfoPropType.isRequired,
    navigate: PropTypes.func.isRequired,
    styles: PropTypes.objectOf(PropTypes.object).isRequired,
  };

  render() {
    let icon, fakeIcon;
    const areSettingsDisabled = threadIsPending(this.props.threadInfo.id);
    if (Platform.OS === 'ios' && !areSettingsDisabled) {
      icon = (
        <Icon
          name="ios-arrow-forward"
          size={20}
          style={this.props.styles.forwardIcon}
        />
      );
      fakeIcon = (
{'fraction_non_alphanumeric': 0.1335914811229429, 'fraction_numerical': 0.0012907389480477573, 'mean_word_length': 3.806201550387597, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4731382', 'n_tokens_mistral': 895, 'n_tokens_neox': 900, 'n_words': 216}