Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Jun 17, 2023
1 parent 2e752f6 commit 4c06264
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const Preview: React.FC<PreviewProps> = props => {
toolbarRender,
onTransform,
onChange,
afterClose,
...restProps
} = props;

Expand Down Expand Up @@ -129,7 +128,6 @@ const Preview: React.FC<PreviewProps> = props => {

const onAfterClose = () => {
resetTransform('close');
afterClose?.();
};

const onZoomIn = () => {
Expand Down
7 changes: 0 additions & 7 deletions src/PreviewGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ const Group: React.FC<GroupConsumerProps> = ({
setMousePosition(null);
};

// if not controlled current, reset to first image when closed
const afterClose = () => {
if (currentIndex === undefined) {
setCurrent(0);
}
};

// ========================= Context ==========================
const previewGroupContext = React.useMemo(
Expand Down Expand Up @@ -155,7 +149,6 @@ const Group: React.FC<GroupConsumerProps> = ({
toolbarRender={toolbarRender}
imageRender={imageRender}
onChange={onInternalChange}
afterClose={afterClose}
{...dialogProps}
/>
</PreviewGroupContext.Provider>
Expand Down

0 comments on commit 4c06264

Please sign in to comment.