Skip to content

Commit

Permalink
Merge pull request #197 from testshallpass/dropdownalert-refactor
Browse files Browse the repository at this point in the history
[Refactor] DropdownAlert internals
  • Loading branch information
testshallpass authored Jun 7, 2019
2 parents ffd4b64 + 8e92ea9 commit 2d8c2fd
Show file tree
Hide file tree
Showing 18 changed files with 1,132 additions and 1,262 deletions.
31 changes: 31 additions & 0 deletions CancelButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { TouchableOpacity } from 'react-native';
import ImageView from './imageview';
import { DEFAULT_IMAGE_DIMENSIONS } from './constants';

export default class CancelButton extends Component {
static propTypes = {
style: PropTypes.object,
onPress: PropTypes.func,
imageStyle: PropTypes.object,
imageSrc: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
static defaultProps = {
onPress: () => {},
style: {
padding: 8,
width: DEFAULT_IMAGE_DIMENSIONS,
height: DEFAULT_IMAGE_DIMENSIONS,
alignSelf: 'center',
},
};
render() {
const { style, onPress, imageStyle, imageSrc } = this.props;
return (
<TouchableOpacity style={style} onPress={onPress}>
<ImageView style={imageStyle} source={imageSrc} />
</TouchableOpacity>
);
}
}
Loading

0 comments on commit 2d8c2fd

Please sign in to comment.