<commit_before>import React, { PropTypes } from 'react'
import { View, StyleSheet, TouchableHighlight, Image, Platform } from 'react-native'
import Badge from '../badge/badge'
import Icon from '../icons/Icon'
import Text from '../text/Text'
import colors from '../config/colors'
import fonts from '../config/fonts'
import normalize from '../helpers/normalizeText'

let styles

const ListItem = ({
  onPress,
  title,
  leftIcon,
  rightIcon,
  avatar,
  avatarStyle,
  underlayColor,
  subtitle,
  subtitleStyle,
  containerStyle,
  wrapperStyle,
  titleStyle,
  titleContainerStyle,
  hideChevron,
  chevronColor,
  roundAvatar,
  component,
  fontFamily,
  rightTitle,
  rightTitleContainerStyle,
  rightTitleStyle,
  subtitleContainerStyle,
  badge,
  badgeContainerStyle,
  badgeTextStyle,
  label,
  onLongPress,
}) => {
  let Component = onPress || onLongPress ? TouchableHighlight : View
  if (component) {
    Component = component
  }
  if (typeof avatar === 'string') {
    avatar = {uri: avatar}
  }
  return (
    <Component
      onLongPress={onLongPress}
      onPress={onPress}
      underlayColor={underlayColor}
      style={[styles.container, containerStyle && containerStyle]}>
      <View style={[styles.wrapper, wrapperStyle && wrapperStyle]}>
        {
          leftIcon && leftIcon.name && (
            <Icon
              type={leftIcon.type}
              iconStyle={[styles.icon, leftIcon.style && leftIcon.style]}
              name={leftIcon.name}
              color={leftIcon.color || colors.grey4}
              size={leftIcon.size || 24}
            />
          )
        }
        {
          avatar && (
            <Image
              style={[
                styles.avatar,
                roundAvatar && {borderRadius: 17},
                avatarStyle && avatarStyle]}
              source={avatar}
              />
          )
        }
        <View style={styles.titleSubtitleContainer}>
          <View style={titleContainerStyle}>
            {(title && (typeof title === 'string')) ? (
              <Text
                style={[
                  styles.title,
                  !leftIcon && {marginLeft: 10},
                  titleStyle && titleStyle,
                  fontFamily && {fontFamily}
                ]}>{title}</Text>
            ) : (
              <View>
                {title}
              </View>
            )}
          </View>
          <View style={subtitleContainerStyle}>
            {(subtitle && (typeof subtitle === 'string')) ? (
              <Text
                style={[
                  styles.subtitle,
                  !leftIcon && {marginLeft: 10},
                  subtitleStyle && subtitleStyle,
                  fontFamily && {fontFamily}
                ]}>{subtitle}</Text>
            ) : (
              <View>
                {subtitle}
              </View>
            )}
          </View>
        </View>
        {
          !hideChevron && !rightTitle && (
            <View style={styles.chevronContainer}>
              <Icon
                type={rightIcon.type}
                style={styles.chevron}
                size={28}
                name={rightIcon.name}
                color={rightIcon.color || chevronColor}
              />
            </View>
          )
        }
        {
          badge && (
            <Badge
              badge={badge}
            />)
        }
        {
          label && label
        }
        {
          rightTitle && (rightTitle !== '') && (
            <View style={[styles.rightTitleContainer, rightTitleContainerStyle]}>
              <Text style={[styles.rightTitleStyle, rightTitleStyle]}>{rightTitle}</Text>
            </View>
          )
        }
      </View>
    </Component>
  )
}

ListItem.defaultProps = {
  underlayColor: 'white',
  chevronColor: colors.grey4,
  rightIcon: {name: 'chevron-right'},
  hideChevron: false,
  roundAvatar: false
}
<commit_msg>feat(ListItem): support both right title and chevron<commit_after>import React, { PropTypes } from 'react'
import { View, StyleSheet, TouchableHighlight, Image, Platform } from 'react-native'
import Badge from '../badge/badge'
import Icon from '../icons/Icon'
import Text from '../text/Text'
import colors from '../config/colors'
import fonts from '../config/fonts'
import normalize from '../helpers/normalizeText'

let styles

const ListItem = ({
  onPress,
  title,
  leftIcon,
  rightIcon,
  avatar,
  avatarStyle,
  underlayColor,
  subtitle,
  subtitleStyle,
  containerStyle,
  wrapperStyle,
  titleStyle,
  titleContainerStyle,
  hideChevron,
  chevronColor,
  roundAvatar,
  component,
  fontFamily,
  rightTitle,
  rightTitleContainerStyle,
  rightTitleStyle,
  subtitleContainerStyle,
  badge,
  badgeContainerStyle,
  badgeTextStyle,
  label,
  onLongPress,
}) => {
  let Component = onPress || onLongPress ? TouchableHighlight : View
  if (component) {
    Component = component
  }
  if (typeof avatar === 'string') {
    avatar = {uri: avatar}
  }
  return (
    <Component
      onLongPress={onLongPress}
      onPress={onPress}
      underlayColor={underlayColor}
      style={[styles.container, containerStyle && containerStyle]}>
      <View style={[styles.wrapper, wrapperStyle && wrapperStyle]}>
        {
          leftIcon && leftIcon.name && (
            <Icon
              type={leftIcon.type}
              iconStyle={[styles.icon, leftIcon.style && leftIcon.style]}
              name={leftIcon.name}
              color={leftIcon.color || colors.grey4}
              size={leftIcon.size || 24}
            />
          )
        }
        {
          avatar && (
            <Image
              style={[
                styles.avatar,
                roundAvatar && {borderRadius: 17},
                avatarStyle && avatarStyle]}
              source={avatar}
              />
          )
        }
        <View style={styles.titleSubtitleContainer}>
          <View style={titleContainerStyle}>
            {(title && (typeof title === 'string')) ? (
              <Text
                style={[
                  styles.title,
                  !leftIcon && {marginLeft: 10},
                  titleStyle && titleStyle,
                  fontFamily && {fontFamily}
                ]}>{title}</Text>
            ) : (
              <View>
                {title}
              </View>
            )}
          </View>
          <View style={subtitleContainerStyle}>
            {(subtitle && (typeof subtitle === 'string')) ? (
              <Text
                style={[
                  styles.subtitle,
                  !leftIcon && {marginLeft: 10},
                  subtitleStyle && subtitleStyle,
                  fontFamily && {fontFamily}
                ]}>{subtitle}</Text>
            ) : (
              <View>
                {subtitle}
              </View>
            )}
          </View>
        </View>
        {
          rightTitle && (rightTitle !== '') && (
            <View style={[styles.rightTitleContainer, rightTitleContainerStyle]}>
              <Text style={[styles.rightTitleStyle, rightTitleStyle]}>{rightTitle}</Text>
            </View>
          )
        }
        {
          !hideChevron && (
            <View style={styles.chevronContainer}>
              <Icon
                type={rightIcon.type}
                style={styles.chevron}
                size={28}
                name={rightIcon.name}
                color={rightIcon.color || chevronColor}
              />
            </View>
          )
        }
        {
          badge && !rightTitle && (
            <Badge
              badge={badge}
            />)
        }
        {
          label && label
        }
      </View>
    </Component>
  )
}

ListItem.defaultProps = {
  underlayColor: 'white',
  chevronColor: colors.grey4,
  rightIcon: {name: 'chevron-right'},
  hideChevron: false,
  roundAvatar: false
}

{'fraction_non_alphanumeric': 0.12130815058942832, 'fraction_numerical': 0.0030422106730891114, 'mean_word_length': 1.5443405353111899, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 61, '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': '1638719', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2124, 'n_words': 414}