the it goes to the "How many pages/screens do you have in mind?

" step
This commit is contained in:
Leon Serfaty G
2025-07-17 11:05:18 +00:00
parent c6172fd957
commit 4e70480cd1
2 changed files with 56 additions and 17 deletions
@@ -72,17 +72,34 @@ export function CostEstimatorForm() {
const handleNextStep = () => {
startTransition(() => {
if (currentStep === 2 && formData.serviceType === 'development') {
setCurrentStep(5);
} else if (currentStep === 2 && formData.serviceType === 'ui-ux-design') {
setCurrentStep(12);
} else if (currentStep === 5 && formData.serviceType === 'development') {
setCurrentStep(9);
} else if (currentStep === 12) {
setCurrentStep(11);
} else {
setCurrentStep((prev) => prev + 1);
// Logic for step 2 (Service Type)
if (currentStep === 2) {
if (formData.serviceType === 'development') setCurrentStep(5);
else if (formData.serviceType === 'ui-ux-design') setCurrentStep(12);
else if (formData.serviceType === 'identity-branding') setCurrentStep(8);
else setCurrentStep(3);
return;
}
// After page count, if service is development, skip to features
if (currentStep === 5 && formData.serviceType === 'development') {
setCurrentStep(9);
return;
}
// After branding, if service is identity-branding, skip to results
if (currentStep === 8 && formData.serviceType === 'identity-branding') {
setCurrentStep(11);
return;
}
// After UI/UX design step, go to page count
if (currentStep === 12) {
setCurrentStep(5);
return;
}
setCurrentStep((prev) => prev + 1);
});
};
@@ -90,14 +107,26 @@ export function CostEstimatorForm() {
startTransition(() => {
if (currentStep === 5 && formData.serviceType === 'development') {
setCurrentStep(2);
} else if (currentStep === 9 && formData.serviceType === 'development') {
return;
}
if (currentStep === 9 && formData.serviceType === 'development') {
setCurrentStep(5);
} else if (currentStep === 12) {
return;
}
if (currentStep === 12) {
setCurrentStep(2);
return;
}
else {
setCurrentStep((prev) => prev - 1);
if (currentStep === 5 && formData.serviceType === 'ui-ux-design') {
setCurrentStep(12);
return;
}
if(currentStep === 8 && formData.serviceType === 'identity-branding') {
setCurrentStep(2);
return;
}
setCurrentStep((prev) => prev - 1);
});
};