<commit_before>import React, {
  Component,
  PropTypes,
  Text,
  Animated,
  Dimensions,
} from 'react-native';

const Screen = Dimensions.get('window');

class Notification extends Component {
  static propTypes = {
    children: PropTypes.node,
    visible: PropTypes.bool,
  };

  static defaultProps = {
    visible: true,
  };

  constructor(props) {
    super(props);

    this.state = {
      opacityValue: new Animated.Value(Notification.minOpacity),
    };
  }

  componentDidMount() {
    if (this.props.visible) {
      this.fadeIn();
    }
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.visible && !this.props.visible) {
      this.fadeIn();
    } else {
      if (!nextProps.visible && this.props.visible) {
        this.fadeOut();
      }
    }
  }

  shouldComponentUpdate(nextProps) {
    // TODO: Compare the messages with each other
    /* if (this.props.message !== nextProps.message) {
      return true;
    }*/

    if (this.props.visible !== nextProps.visible) {
      return true;
    }

    // TODO: Is there a reliable way not use `__getValue` and something else that may not be as unstable
    if (this.state.opacityValue.__getValue() !== this.state.opacityValue.__getValue()) {
      return true;
    }

    return false;
  }

  static fadeTime = 500;
  static minOpacity = 0.0;
  static maxOpacity = 0.9;

  static styles = {
    container: {
      position: 'absolute',
      top: Screen.height - 35 - (Screen.height / 12),
      width: Screen.width - 80,
      left: 40,
      right: 40,
      backgroundColor: '#444',
      alignItems: 'center',
      padding: 6,
      opacity: Notification.minOpacity,
      borderRadius: 12,
      shadowColor: '#000',
      shadowOpacity: 0.5,
      shadowRadius: 1,
      shadowOffset: {
        width: 0,
        height: 1,
      },
    },
    message: {
      color: '#fff',
      fontSize: 12,
      textAlign: 'center',
    },
  };

  fadeIn() {
    Animated.timing(this.state.opacityValue, {
      duration: Notification.fadeTime,
      toValue: Notification.maxOpacity,
    }).start();
  }<commit_msg>Use `bottom` instead of `top`<commit_after>import React, {
  Component,
  PropTypes,
  Text,
  Animated,
  Dimensions,
} from 'react-native';

const Screen = Dimensions.get('window');

class Notification extends Component {
  static propTypes = {
    children: PropTypes.node,
    visible: PropTypes.bool,
  };

  static defaultProps = {
    visible: true,
  };

  constructor(props) {
    super(props);

    this.state = {
      opacityValue: new Animated.Value(Notification.minOpacity),
    };
  }

  componentDidMount() {
    if (this.props.visible) {
      this.fadeIn();
    }
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.visible && !this.props.visible) {
      this.fadeIn();
    } else {
      if (!nextProps.visible && this.props.visible) {
        this.fadeOut();
      }
    }
  }

  shouldComponentUpdate(nextProps) {
    // TODO: Compare the messages with each other
    /* if (this.props.message !== nextProps.message) {
      return true;
    }*/

    if (this.props.visible !== nextProps.visible) {
      return true;
    }

    // TODO: Is there a reliable way not use `__getValue` and something else that may not be as unstable
    if (this.state.opacityValue.__getValue() !== this.state.opacityValue.__getValue()) {
      return true;
    }

    return false;
  }

  static fadeTime = 500;
  static minOpacity = 0.0;
  static maxOpacity = 0.9;

  static styles = {
    container: {
      position: 'absolute',
      bottom: 35,
      width: Screen.width - 80,
      left: 40,
      right: 40,
      backgroundColor: '#444',
      alignItems: 'center',
      padding: 6,
      opacity: Notification.minOpacity,
      borderRadius: 12,
      shadowColor: '#000',
      shadowOpacity: 0.5,
      shadowRadius: 1,
      shadowOffset: {
        width: 0,
        height: 1,
      },
    },
    message: {
      color: '#fff',
      fontSize: 12,
      textAlign: 'center',
    },
  };

  fadeIn() {
    Animated.timing(this.state.opacityValue, {
      duration: Notification.fadeTime,
      toValue: Notification.maxOpacity,
    }).start();
  }
{'fraction_non_alphanumeric': 0.12871524448705657, 'fraction_numerical': 0.015340364333652923, 'mean_word_length': 2.3707592891760907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '28370', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1288, 'n_words': 301}