Skip to content

Commit b5c14c9

Browse files
committed
chore: auto close BuyBox dialog after 4 seconds
1 parent 4e6cafa commit b5c14c9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/app/[locale]/(main)/(container)/products/[...params]/components/AddToCartDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const AddToCartDialog: FC<AddToCartDialogProps> = ({
5454
children: t('pages.cart.addToCartDialog.resume'),
5555
fullWidth: true,
5656
size: 'large',
57+
disabled: isPending,
5758
},
5859
]}
5960
dialogContentProps={{

src/app/[locale]/(main)/(container)/products/[...params]/components/BuyBox.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ const BuyBox: FC<BuyBoxProps> = ({ product }) => {
7676
});
7777
if (data) {
7878
handleOpenDialog();
79+
setTimeout(() => {
80+
handleCloseDialog();
81+
}, 4000);
7982
}
8083
};
8184

0 commit comments

Comments
 (0)