Skip to content

Commit

Permalink
fix: Reduced restore time
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Pinedo committed Oct 6, 2022
1 parent 75dadf7 commit e53c855
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stories/components/Popper/CustomPopper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ interface PopperProps {
popperRef: Dispatch<SetStateAction<null>>;
}

const DEFAULT_RESTORE_TIME = 2500;

export const CustomPopper: FC<PopperProps> = ({
item,
styles,
Expand All @@ -51,7 +53,7 @@ export const CustomPopper: FC<PopperProps> = ({
if (result) {
setCopiedClassName(true);
setCopiedReactComponent(false);
setTimeout(() => setCopiedClassName(false), 4000);
setTimeout(() => setCopiedClassName(false), DEFAULT_RESTORE_TIME);
}
};

Expand All @@ -60,14 +62,14 @@ export const CustomPopper: FC<PopperProps> = ({
if (result) {
setCopiedReactComponent(true);
setCopiedClassName(false);
setTimeout(() => setCopiedReactComponent(false), 4000);
setTimeout(() => setCopiedReactComponent(false), DEFAULT_RESTORE_TIME);
}
};

const handleDownloadSVG = async (item: SingleItem) => {
if (downloadIcon(item)) {
setDownloadedSVG(true);
setTimeout(() => setDownloadedSVG(false), 4000);
setTimeout(() => setDownloadedSVG(false), DEFAULT_RESTORE_TIME);
}
};

Expand Down

0 comments on commit e53c855

Please sign in to comment.