<commit_before>/* @flow */

import React, { PropTypes } from 'react';
import {
  I18nManager,
  Image,
  Text,
  View,
  Platform,
  StyleSheet,
} from 'react-native';

import TouchableItem from './TouchableItem';

type Props = {
  onPress: Function,
  title?: string,
  tintColor?: string;
};

const HeaderBackButton = ({ onPress, title, tintColor }: Props) => (
  <TouchableItem
    delayPressIn={0}
    onPress={onPress}
    style={styles.container}
    borderless
  >
    <View style={styles.container}>
      <Image
        style={styles.button}
        source={require('./assets/back-icon.png')}
        tintColor={tintColor}
      />
      {Platform.OS === 'ios' && title && (
        <Text style={[styles.title, { color: tintColor }]}>
          {title}
        </Text>
      )}
    </View>
  </TouchableItem>
);

HeaderBackButton.propTypes = {
  onPress: PropTypes.func.isRequired,
  tintColor: PropTypes.string,
};

HeaderBackButton.defaultProps = {
  tintColor: Platform.select({
    ios: '#037aff',
  }),
};

const styles = StyleSheet.create({
  container: {
    alignItems: 'center',
    justifyContent: 'center',
    flexDirection: 'row',
  },
  title: {
    fontSize: 17,
  },
  button: Platform.OS === 'ios'
    ? {
      height: 21,
      width: 13,
      margin: 10,
      marginRight: 5,
      transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
    }
    : {
      height: 24,
      width: 24,
      margin: 16,
      resizeMode: 'contain',
      transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
    },
});

export default HeaderBackButton;
<commit_msg>Fix back button tinting (#144)<commit_after>/* @flow */

import React, { PropTypes } from 'react';
import {
  I18nManager,
  Image,
  Text,
  View,
  Platform,
  StyleSheet,
} from 'react-native';

import TouchableItem from './TouchableItem';

type Props = {
  onPress: Function,
  title?: string,
  tintColor?: string;
};

const HeaderBackButton = ({ onPress, title, tintColor }: Props) => (
  <TouchableItem
    delayPressIn={0}
    onPress={onPress}
    style={styles.container}
    borderless
  >
    <View style={styles.container}>
      <Image
        style={[styles.button, { tintColor }]}
        source={require('./assets/back-icon.png')}
      />
      {Platform.OS === 'ios' && title && (
        <Text style={[styles.title, { color: tintColor }]}>
          {title}
        </Text>
      )}
    </View>
  </TouchableItem>
);

HeaderBackButton.propTypes = {
  onPress: PropTypes.func.isRequired,
  tintColor: PropTypes.string,
};

HeaderBackButton.defaultProps = {
  tintColor: Platform.select({
    ios: '#037aff',
  }),
};

const styles = StyleSheet.create({
  container: {
    alignItems: 'center',
    justifyContent: 'center',
    flexDirection: 'row',
  },
  title: {
    fontSize: 17,
  },
  button: Platform.OS === 'ios'
    ? {
      height: 21,
      width: 13,
      margin: 10,
      marginRight: 5,
      transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
    }
    : {
      height: 24,
      width: 24,
      margin: 16,
      resizeMode: 'contain',
      transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
    },
});

export default HeaderBackButton;

{'fraction_non_alphanumeric': 0.15727848101265823, 'fraction_numerical': 0.01930379746835443, 'mean_word_length': 2.620847651775487, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '3602199', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1080, 'n_words': 226}