-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from testshallpass/dropdownalert-refactor
[Refactor] DropdownAlert internals
- Loading branch information
Showing
18 changed files
with
1,132 additions
and
1,262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} | ||
} |
Oops, something went wrong.