Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
Update index.js (#22)
Browse files Browse the repository at this point in the history
Last item in data array will not show next arrow
First item in data array will not show previous arrow
  • Loading branch information
PrinoyDcosta authored Feb 8, 2021
1 parent bfbc134 commit a936a85
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,23 @@ class ReactImageVideoLightbox extends React.Component {
fontSize: `${this.state.iconSize * 0.8}px`
}}
onClick={this.props.onCloseCallback} />

<NavigateBefore
style={{
position: 'absolute',
left: '0px',
zIndex: 1,
color: '#FFFFFF',
cursor: 'pointer',
fontSize: `${this.state.iconSize}px`
}}
onClick={() => { this.swipeLeft(); }} />

{
(this.state.index + 1 != 1)?
<NavigateBefore
style={{
position: 'absolute',
left: '0px',
zIndex: 1,
color: '#FFFFFF',
cursor: 'pointer',
fontSize: `${this.state.iconSize}px`
}}
onClick={() => { this.swipeLeft(); }} />
:
<></>
}
{
(this.state.index + 1 != this.props.data.length)?
<NavigateNext
style={{
position: 'absolute',
Expand All @@ -337,7 +342,9 @@ class ReactImageVideoLightbox extends React.Component {
fontSize: `${this.state.iconSize}px`
}}
onClick={() => { this.swipeRight(); }} />

:
<></>
}
{
this.state.loading &&
<CircularProgress
Expand Down

0 comments on commit a936a85

Please sign in to comment.