Skip to content

Commit

Permalink
updated functionality of the back button
Browse files Browse the repository at this point in the history
  • Loading branch information
awaismohammad23 committed Dec 9, 2023
1 parent 1d6c159 commit 253cd40
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,20 @@ function Tutor() {
};

const handleCloseModal = () => {
setShowConfirmationMenu(false);
setConfirmationStep(1); // Reset confirmation step when closing modal
if (confirmationStep > 1) {
setConfirmationStep((prevStep) => prevStep - 1);
} else {
setShowConfirmationMenu(false);
setConfirmationStep(1); // Reset confirmation step when closing modal
}
};

const handleBackStep = () => {
setConfirmationStep((prevStep) => Math.max(prevStep - 1, 1));
};

const handleNextStep = () => {
setConfirmationStep((prevStep) => prevStep + 1);
setConfirmationStep((prevStep) => Math.min(prevStep + 1, 3));
};

const renderConfirmationStep = () => {
Expand Down

0 comments on commit 253cd40

Please sign in to comment.