Skip to content

Commit 9b06027

Browse files
committed
feat: Remove summary step from avatar generation flow
- Remove unnecessary summary step before preview/download - Go directly from keywords step (step 4) to avatar preview - Update button logic to show 'Generate my avatar' on step 4 - Streamline user experience by eliminating redundant review step - Maintain all functionality while reducing flow complexity
1 parent 90e0989 commit 9b06027

File tree

1 file changed

+10
-68
lines changed

1 file changed

+10
-68
lines changed

src/app/my-avatar/page.tsx

Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,18 @@ export default function MyAvatarPage() {
110110
return avatarData.buzzvilPrinciple;
111111
case 3: // Role and organization
112112
return avatarData.role && avatarData.organizationDescription;
113-
case 4: // Keywords
113+
case 4: // Keywords - final step before preview
114114
return avatarData.keywords[0]?.trim();
115-
case 5: // Final step - check all required fields
116-
return (
117-
avatarData.name.trim() &&
118-
avatarData.buzzvilValue &&
119-
avatarData.buzzvilPrinciple &&
120-
avatarData.role &&
121-
avatarData.organizationDescription &&
122-
avatarData.keywords[0]?.trim()
123-
);
124115
default:
125116
return false;
126117
}
127118
};
128119

129120
const nextStep = () => {
130-
if (currentStep < STEPS.length - 1) {
121+
if (currentStep === 4) {
122+
// After keywords step, go directly to preview
123+
setShowPreview(true);
124+
} else if (currentStep < STEPS.length - 1) {
131125
setCurrentStep(currentStep + 1);
132126
}
133127
};
@@ -334,60 +328,8 @@ export default function MyAvatarPage() {
334328
);
335329

336330
case 5:
337-
return (
338-
<div className="space-y-8">
339-
<div className="text-center">
340-
<h2 className="text-3xl font-bold text-foreground mb-4">Ready to Generate?</h2>
341-
<p className="text-muted-foreground text-lg">Review your information and generate your avatar card</p>
342-
</div>
343-
344-
<div className="max-w-2xl mx-auto">
345-
{/* Summary Card */}
346-
<div className="bg-gradient-to-br from-background to-muted/20 p-8 rounded-2xl border border-border shadow-lg">
347-
<div className="space-y-4">
348-
<div>
349-
<h4 className="font-medium text-foreground mb-2">Name</h4>
350-
<p className="text-foreground">{avatarData.name}</p>
351-
</div>
352-
353-
<div>
354-
<h4 className="font-medium text-foreground mb-2">Buzzvil Value</h4>
355-
<p className="text-accent capitalize">{avatarData.buzzvilValue.replace('-', ' ')}</p>
356-
</div>
357-
358-
<div>
359-
<h4 className="font-medium text-foreground mb-2">Design Principle</h4>
360-
<p className="text-muted-foreground capitalize">{avatarData.buzzvilPrinciple.replace('-', ' ')}</p>
361-
</div>
362-
363-
<div>
364-
<h4 className="font-medium text-foreground mb-2">Role</h4>
365-
<p className="text-muted-foreground">{avatarData.role}</p>
366-
</div>
367-
368-
<div>
369-
<h4 className="font-medium text-foreground mb-2">Organization Description</h4>
370-
<p className="text-muted-foreground">{avatarData.organizationDescription}</p>
371-
</div>
372-
373-
<div>
374-
<h4 className="font-medium text-foreground mb-2">Expertise</h4>
375-
<div className="flex flex-wrap gap-2">
376-
{avatarData.keywords.filter(k => k.trim()).map((keyword, index) => (
377-
<span
378-
key={index}
379-
className="px-3 py-1 bg-accent/10 text-accent rounded-full text-sm font-medium"
380-
>
381-
{keyword}
382-
</span>
383-
))}
384-
</div>
385-
</div>
386-
</div>
387-
</div>
388-
</div>
389-
</div>
390-
);
331+
// This step is now removed - go directly to preview
332+
return null;
391333

392334
default:
393335
return null;
@@ -498,16 +440,16 @@ export default function MyAvatarPage() {
498440
<motion.button
499441
whileHover={{ scale: 1.02 }}
500442
whileTap={{ scale: 0.98 }}
501-
onClick={currentStep === STEPS.length - 1 ? generateAvatar : nextStep}
443+
onClick={currentStep === 4 ? generateAvatar : nextStep}
502444
disabled={!isStepComplete(currentStep)}
503445
className={`flex items-center space-x-2 px-6 py-3 rounded-lg font-medium transition-colors ${
504446
!isStepComplete(currentStep)
505447
? 'text-muted-foreground cursor-not-allowed'
506448
: 'bg-accent text-white hover:bg-accent/90'
507449
}`}
508450
>
509-
<span>{currentStep === STEPS.length - 1 ? 'Generate my avatar' : 'Next'}</span>
510-
{currentStep === STEPS.length - 1 ? (
451+
<span>{currentStep === 4 ? 'Generate my avatar' : 'Next'}</span>
452+
{currentStep === 4 ? (
511453
<Sparkles className="w-4 h-4" />
512454
) : (
513455
<ArrowRight className="w-4 h-4" />

0 commit comments

Comments
 (0)