Skip to content

Commit

Permalink
Added prop to disable the PrevButton (leecade#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesar-salad authored and ArrayZoneYour committed Jun 27, 2019
1 parent 0e850fb commit fa52596
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default class extends Component {
showsPagination: PropTypes.bool,
showsButtons: PropTypes.bool,
disableNextButton: PropTypes.bool,
disablePrevButton: PropTypes.bool,
loadMinimal: PropTypes.bool,
loadMinimalSize: PropTypes.number,
loadMinimalLoader: PropTypes.element,
Expand Down Expand Up @@ -155,6 +156,7 @@ export default class extends Component {
showsPagination: true,
showsButtons: false,
disableNextButton: false,
disablePrevButton: false,
loop: true,
loadMinimal: false,
loadMinimalSize: 1,
Expand Down Expand Up @@ -687,8 +689,13 @@ export default class extends Component {
}

return (
<TouchableOpacity onPress={() => button !== null && this.scrollBy(-1)}>
<View>{button}</View>
<TouchableOpacity
onPress={() => button !== null && this.scrollBy(-1)}
disabled={this.props.disablePrevButton}
>
<View>
{button}
</View>
</TouchableOpacity>
)
}
Expand Down

0 comments on commit fa52596

Please sign in to comment.