{"size": 703, "ext": "js", "max_stars_repo_path": "client/src/components/mission/MyModal.js", "max_stars_repo_name": "exKAZUu-Research/WillingQuiz", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/components/mission/MyModal.js", "max_issues_repo_name": "exKAZUu-Research/WillingQuiz", "max_issues_repo_issues_event_min_datetime": "2019-12-18T15:34:48.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-18T15:34:52.000Z", "max_forks_repo_path": "client/src/components/mission/MyModal.js", "max_forks_repo_name": "exKAZUu-Research/WillingQuiz", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 23.4333333333, "max_line_length": 66, "alphanum_fraction": 0.5945945946}
// @flow

import React from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import Modal from 'react-native-modal';

import { GS } from '../style';
import { D, i18n } from '../../i18n/index';

type ModalProps = {
  visible: boolean,
  hide: () => any,
  children: any,
};

export function MyModal({ visible, hide, children }: ModalProps) {
  return (
    <Modal isVisible={visible} onBackdropPress={hide}>
      <View style={GS.modal}>
        {children}
        <TouchableOpacity onPress={hide}>
          <View style={[GS.mainButton, GS.modalButton]}>
            <Text>{i18n(D().common.ok)}</Text>
          </View>
        </TouchableOpacity>
      </View>
    </Modal>
  );
}
