<commit_before>/* eslint-disable react/forbid-prop-types */
/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2019
 */

import React from 'react';
import PropTypes from 'prop-types';

import { Keyboard, StyleSheet, View } from 'react-native';
import Modal from 'react-native-modalbox';

import { DARKER_GREY } from '../../globalStyles/index';

export const BottomModalContainer = ({
  children,
  isOpen,
  swipeToClose,
  backdropPressToClose,
  position,
  backdrop,
  modalStyle,
  containerStyle,
  ...modalProps
}) => {
  React.useEffect(() => {
    Keyboard.dismiss();
  }, [isOpen]);

  return (
    <Modal
      swipeToClose={swipeToClose}
      backdropPressToClose={backdropPressToClose}
      position={position}
      backdrop={backdrop}
      {...modalProps}
      style={localStyles.modalStyle}
    >
      <View style={localStyles.containerStyle}>{children}</View>
    </Modal>
  );
};

const localStyles = StyleSheet.create({
  containerStyle: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  modalStyle: {
    height: 60,
    justifyContent: 'center',
    alignItems: 'flex-end',
    backgroundColor: DARKER_GREY,
  },
});

BottomModalContainer.defaultProps = {
  swipeToClose: false,
  backdropPressToClose: false,
  position: 'bottom',
  backdrop: false,
  modalStyle: localStyles.modalStyle,<commit_msg>Add corrected prop usage in BottomModalContainer<commit_after>/* eslint-disable react/forbid-prop-types */
/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2019
 */

import React from 'react';
import PropTypes from 'prop-types';

import { Keyboard, StyleSheet, View } from 'react-native';
import Modal from 'react-native-modalbox';

import { DARKER_GREY } from '../../globalStyles/index';

export const BottomModalContainer = ({
  children,
  isOpen,
  swipeToClose,
  backdropPressToClose,
  position,
  backdrop,
  modalStyle,
  containerStyle,
  ...modalProps
}) => {
  React.useEffect(() => {
    Keyboard.dismiss();
  }, [isOpen]);

  return (
    <Modal
      swipeToClose={swipeToClose}
      backdropPressToClose={backdropPressToClose}
      position={position}
      backdrop={backdrop}
      isOpen={isOpen}
      {...modalProps}
      style={localStyles.modalStyle}
    >
      <View style={localStyles.containerStyle}>{children}</View>
    </Modal>
  );
};

const localStyles = StyleSheet.create({
  containerStyle: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  modalStyle: {
    height: 60,
    justifyContent: 'center',
    alignItems: 'flex-end',
    backgroundColor: DARKER_GREY,
  },
});

BottomModalContainer.defaultProps = {
  swipeToClose: false,
  backdropPressToClose: false,
  position: 'bottom',
  backdrop: false,
  modalStyle: localStyles.modalStyle,
{'fraction_non_alphanumeric': 0.13583713583713583, 'fraction_numerical': 0.004212004212004212, 'mean_word_length': 3.6644844517184945, 'pattern_counts': {'":': 0, '<': 11, '<?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': '928006', 'n_tokens_mistral': 929, 'n_tokens_neox': 923, 'n_words': 185}