Skip to content

Commit

Permalink
onPress for Avatar Component
Browse files Browse the repository at this point in the history
  • Loading branch information
guns2410 committed Mar 6, 2018
1 parent bc52250 commit a7c5be7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export default class Avatar extends React.PureComponent {
}

const ImageComponent = this.props.ImageComponent || Image;
const ContainerComponent = this.props.onPress ? Button : View

return (
<View style={[{ marginRight: this.props.borderColors.length > 0 ? 10 : 0 }, this.props.containerStyle]}>
<ContainerComponent
styleLess
onPress={this.props.onPress}
style={[{ marginRight: this.props.borderColors.length > 0 ? 10 : 0 }, this.props.containerStyle]}>
<View theme={this.theme} style={[this.theme.avatar.container, otherContainerStyles]}
colors={this.props.borderColors}>
<ImageComponent
Expand Down

0 comments on commit a7c5be7

Please sign in to comment.