Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default class App extends React.Component {
| footerContainerStyle | object<br><br>`{someStyle: someValue}` | no | custom style props for container that will be holding your footer that you pass | `bottom: 0, position: "absolute", zIndex: 9999` |
| backgroundColor | string<br><br>`white` | no | Component background color | `black` |
| enableSwipeDown | boolean | no | Enable swipe down to close image viewer. When swipe down, will trigger onCancel. | false |
| swipeDownThreshold | number | no | Threshold for firing swipe down function | |
| doubleClickInterval | number | no | Double click interval. | |
| pageAnimateTime | number | no | Set the animation time for page flipping. | 100 |
| enablePreload | boolean | no | Preload the next image | false |
Expand Down
2 changes: 2 additions & 0 deletions src/image-viewer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ export default class ImageViewer extends React.Component<Props, State> {
onClick={this.handleClick}
onDoubleClick={this.handleDoubleClick}
enableSwipeDown={this.props.enableSwipeDown}
swipeDownThreshold={this.props.swipeDownThreshold}
onSwipeDown={this.handleSwipeDown}
pinchToZoom={this.props.enableImageZoom}
enableDoubleClickZoom={this.props.enableImageZoom}
Expand Down Expand Up @@ -541,6 +542,7 @@ export default class ImageViewer extends React.Component<Props, State> {
imageWidth={width}
imageHeight={height}
enableSwipeDown={this.props.enableSwipeDown}
swipeDownThreshold={this.props.swipeDownThreshold}
onSwipeDown={this.handleSwipeDown}
pinchToZoom={this.props.enableImageZoom}
enableDoubleClickZoom={this.props.enableImageZoom}
Expand Down
5 changes: 5 additions & 0 deletions src/image-viewer.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export class Props {
*/
public enableSwipeDown?: boolean = false;

/**
* threshold for firing swipe down function
*/
public swipeDownThreshold?: number;

public doubleClickInterval?: number;

/**
Expand Down