<commit_before>/* @flow weak */

/**
 * OfflineMobile Android
 * Sustainable Solutions (NZ) Ltd. 2016
 */

import React from 'react';
import {
  Text,
  StyleSheet,
  View,
} from 'react-native';
import { Button } from '../Button';
import { BottomModal } from './BottomModal';
import globalStyles, { SUSSOL_ORANGE, WARM_GREY } from '../../globalStyles';

export function BottomConfirmModal(props) {
  const { onCancel, onConfirm, questionText, confirmText, cancelText, ...modalProps } = props;
  return (
    <BottomModal {...modalProps}>
      <Text style={[globalStyles.text, localStyles.questionText]}>
        {questionText}
      </Text>
      <Button
        style={[globalStyles.button, localStyles.cancelButton]}
        textStyle={[globalStyles.buttonText, localStyles.buttonText]}
        text={cancelText}
        onPress={onCancel}
      />
      <Button
        style={[globalStyles.button, localStyles.deleteButton]}
        textStyle={[globalStyles.buttonText, localStyles.buttonText]}
        text={confirmText}
        onPress={onConfirm}
      />
    </BottomModal>
   );
}

BottomConfirmModal.propTypes = {
  style: View.propTypes.style,
  isOpen: React.PropTypes.bool.isRequired,
  questionText: React.PropTypes.string.isRequired,
  onCancel: React.PropTypes.func.isRequired,
  onConfirm: React.PropTypes.func.isRequired,
  cancelText: React.PropTypes.string,
  confirmText: React.PropTypes.string,
};
BottomConfirmModal.defaultProps = {
  style: {},
  cancelText: 'Cancel',
  confirmText: 'Confirm',
  swipeToClose: false, // negating the default.
  backdropPressToClose: false, // negating the default.
  position: 'bottom',
  backdrop: false,
};

const localStyles = StyleSheet.create({
  questionText: {
    color: 'white',
    fontSize: 22,
    paddingRight: 10,
  },
  buttonText: {
    color: 'white',
  },
  cancelButton: {
    borderColor: 'white',
  },
  deleteButton: {
    borderColor: 'white',
    backgroundColor: SUSSOL_ORANGE,
  },
});<commit_msg>Remove redundant default props in BottomConfirmModal<commit_after>/* @flow weak */

/**
 * OfflineMobile Android
 * Sustainable Solutions (NZ) Ltd. 2016
 */

import React from 'react';
import {
  Text,
  StyleSheet,
  View,
} from 'react-native';
import { Button } from '../Button';
import { BottomModal } from './BottomModal';
import globalStyles, { SUSSOL_ORANGE, WARM_GREY } from '../../globalStyles';

export function BottomConfirmModal(props) {
  const { onCancel, onConfirm, questionText, confirmText, cancelText, ...modalProps } = props;
  return (
    <BottomModal {...modalProps}>
      <Text style={[globalStyles.text, localStyles.questionText]}>
        {questionText}
      </Text>
      <Button
        style={[globalStyles.button, localStyles.cancelButton]}
        textStyle={[globalStyles.buttonText, localStyles.buttonText]}
        text={cancelText}
        onPress={onCancel}
      />
      <Button
        style={[globalStyles.button, localStyles.deleteButton]}
        textStyle={[globalStyles.buttonText, localStyles.buttonText]}
        text={confirmText}
        onPress={onConfirm}
      />
    </BottomModal>
   );
}

BottomConfirmModal.propTypes = {
  style: View.propTypes.style,
  isOpen: React.PropTypes.bool.isRequired,
  questionText: React.PropTypes.string.isRequired,
  onCancel: React.PropTypes.func.isRequired,
  onConfirm: React.PropTypes.func.isRequired,
  cancelText: React.PropTypes.string,
  confirmText: React.PropTypes.string,
};
BottomConfirmModal.defaultProps = {
  style: {},
  cancelText: 'Cancel',
  confirmText: 'Confirm',
};

const localStyles = StyleSheet.create({
  questionText: {
    color: 'white',
    fontSize: 22,
    paddingRight: 10,
  },
  buttonText: {
    color: 'white',
  },
  cancelButton: {
    borderColor: 'white',
  },
  deleteButton: {
    borderColor: 'white',
    backgroundColor: SUSSOL_ORANGE,
  },
});
{'fraction_non_alphanumeric': 0.13419689119170986, 'fraction_numerical': 0.004145077720207254, 'mean_word_length': 3.5423529411764707, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3857052', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1200, 'n_words': 239}