Skip to content

Commit

Permalink
refactor: transformAction switch -> prev、next (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi authored Jun 14, 2023
1 parent c795411 commit bff2fba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ type TransformAction =
| 'zoomIn'
| 'zoomOut'
| 'close'
| 'switch'
| 'prev'
| 'next'
| 'wheel'
| 'doubleClick'
| 'move'
Expand Down
4 changes: 2 additions & 2 deletions src/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const Preview: React.FC<PreviewProps> = props => {
event.stopPropagation();
if (currentPreviewIndex > 0) {
setEnableTransition(false);
resetTransform('switch');
resetTransform('prev');
setCurrent(previewDataKeys[currentPreviewIndex - 1]);
}
};
Expand All @@ -166,7 +166,7 @@ const Preview: React.FC<PreviewProps> = props => {
event.stopPropagation();
if (currentPreviewIndex < previewGroupCount - 1) {
setEnableTransition(false);
resetTransform('switch');
resetTransform('next');
setCurrent(previewDataKeys[currentPreviewIndex + 1]);
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useImageTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export type TransformAction =
| 'zoomIn'
| 'zoomOut'
| 'close'
| 'switch'
| 'prev'
| 'next'
| 'wheel'
| 'doubleClick'
| 'move'
Expand Down

1 comment on commit bff2fba

@vercel
Copy link

@vercel vercel bot commented on bff2fba Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.