{"size": 580, "ext": "js", "max_stars_repo_path": "src/elements/ImageButton.js", "max_stars_repo_name": "tranhoangduong1994/react-native-boilerplate", "max_stars_repo_stars_event_min_datetime": "2019-02-28T10:20:22.000Z", "max_stars_repo_stars_event_max_datetime": "2019-08-09T06:32:27.000Z", "max_issues_repo_path": "src/elements/ImageButton.js", "max_issues_repo_name": "tranhoangduong1994/react-native-boilerplate", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/elements/ImageButton.js", "max_forks_repo_name": "tranhoangduong1994/react-native-boilerplate", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 10, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.7142857143, "max_line_length": 84, "alphanum_fraction": 0.6517241379}
/**
 * @flow
 */

import React from 'react';
import { Image, ImageRequireSource, TouchableOpacity } from 'react-native';
import { wrap } from '@agiletechvn/react-theme';

type Props = {
  width: number,
  height: number,
  image: ImageRequireSource,
  callback: () => void
};

const ImageButton = wrap((props: Props) => {
  const {
    width, height, image, callback
  } = props;
  return (
    <TouchableOpacity onPress={callback}>
      <Image source={image} cls={`wd-${width} hg-${height}`} resizeMode="contain" />
    </TouchableOpacity>
  );
});

export default ImageButton;
