Skip to content

Commit 857205d

Browse files
committed
Fix Complete button functionality and navigation
- Fix Complete button to call generateXML instead of nextStep on final step - Remove duplicate download button from preview section - Update button icon to show Download icon on final step - Simplify disabled logic to only check isStepComplete - Complete button now properly downloads XML when all fields are filled
1 parent f0dad9c commit 857205d

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/app/my-avatar/page.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,6 @@ export default function MyAvatarPage() {
382382
</div>
383383
</div>
384384
</div>
385-
386-
<motion.button
387-
whileHover={{ scale: 1.02 }}
388-
whileTap={{ scale: 0.98 }}
389-
onClick={generateXML}
390-
className="w-full mt-8 bg-accent text-white py-4 px-6 rounded-lg font-semibold hover:bg-accent/90 transition-colors flex items-center justify-center space-x-2"
391-
>
392-
<Download className="w-5 h-5" />
393-
<span>Download XML File</span>
394-
</motion.button>
395385
</div>
396386
</div>
397387
);
@@ -442,16 +432,20 @@ export default function MyAvatarPage() {
442432
<motion.button
443433
whileHover={{ scale: 1.02 }}
444434
whileTap={{ scale: 0.98 }}
445-
onClick={nextStep}
446-
disabled={currentStep === STEPS.length - 1 || !isStepComplete(currentStep)}
435+
onClick={currentStep === STEPS.length - 1 ? generateXML : nextStep}
436+
disabled={!isStepComplete(currentStep)}
447437
className={`flex items-center space-x-2 px-6 py-3 rounded-lg font-medium transition-colors ${
448-
currentStep === STEPS.length - 1 || !isStepComplete(currentStep)
438+
!isStepComplete(currentStep)
449439
? 'text-muted-foreground cursor-not-allowed'
450440
: 'bg-accent text-white hover:bg-accent/90'
451441
}`}
452442
>
453443
<span>{currentStep === STEPS.length - 1 ? 'Complete' : 'Next'}</span>
454-
<ArrowRight className="w-4 h-4" />
444+
{currentStep === STEPS.length - 1 ? (
445+
<Download className="w-4 h-4" />
446+
) : (
447+
<ArrowRight className="w-4 h-4" />
448+
)}
455449
</motion.button>
456450
</div>
457451
</div>

0 commit comments

Comments
 (0)