Add Photos onboarding step; let pending/rejected users re-edit freely

- New /onboarding/photos step (upload/delete grid, needs >=1 photo to
  continue), inserted as step 2 right after basic info.
- Pending screen gets an "edit your info" entry point into the wizard;
  Rejected screen's edit button now goes there too instead of just
  the read-only profile page.
- Step 1's back button now returns to /home instead of /login when
  the user is already onboarded (was previously always /login).
- Progress bar segments become clickable to jump directly to any step
  once the user is already onboarded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-16 09:22:32 +03:30
parent 501fa294f4
commit dca8c5e9e3
6 changed files with 168 additions and 18 deletions
+5
View File
@@ -342,6 +342,11 @@ export function submitBasicInfo(payload: {
});
}
// خودِ عکس‌ها با uploadPhoto/deletePhoto آپلود می‌شن؛ این فقط مرحله رو تایید/رد می‌کنه
export function confirmPhotosStep() {
return authRequest<OnboardingStatus>("/onboarding/photos", { method: "POST" });
}
export function submitBodyInfo(payload: { height_cm: number; weight_kg: number }) {
return authRequest<OnboardingStatus>("/onboarding/body-info", {
method: "POST",
+8 -7
View File
@@ -9,19 +9,20 @@ export interface StepMeta {
// همون ترتیب و کلیدهایی که بک‌اند در models.OnboardingStepOrder برمی‌گردونه
export const ONBOARDING_STEPS: StepMeta[] = [
{ key: "basic_info", slug: "basic-info", order: 1, title: "خب اول بگو کی هستی", emoji: "👋" },
{ key: "body_info", slug: "body-info", order: 2, title: "قد و وزنت چقدره؟", emoji: "📏" },
{ key: "profile_questions", slug: "profile-questions", order: 3, title: "یکم از خودت بگو", emoji: "💬" },
{ key: "education", slug: "education", order: 4, title: "تحصیلاتت چیه؟", emoji: "🎓" },
{ key: "occupations", slug: "occupations", order: 5, title: "چیکار می‌کنی؟", emoji: "💼" },
{ key: "photos", slug: "photos", order: 2, title: "چندتا عکس از خودت بذار", emoji: "📸" },
{ key: "body_info", slug: "body-info", order: 3, title: "قد و وزنت چقدره؟", emoji: "📏" },
{ key: "profile_questions", slug: "profile-questions", order: 4, title: "یکم از خودت بگو", emoji: "💬" },
{ key: "education", slug: "education", order: 5, title: "تحصیلاتت چیه؟", emoji: "🎓" },
{ key: "occupations", slug: "occupations", order: 6, title: "چیکار می‌کنی؟", emoji: "💼" },
{
key: "relationship_importance",
slug: "relationship-importance",
order: 6,
order: 7,
title: "توی رابطه چی برات مهمه؟",
emoji: "❤️",
},
{ key: "interests", slug: "interests", order: 7, title: "به چی علاقه داری؟", emoji: "✨" },
{ key: "looking_for", slug: "looking-for", order: 8, title: "دنبال چی می‌گردی؟", emoji: "🔍" },
{ key: "interests", slug: "interests", order: 8, title: "به چی علاقه داری؟", emoji: "✨" },
{ key: "looking_for", slug: "looking-for", order: 9, title: "دنبال چی می‌گردی؟", emoji: "🔍" },
];
export function stepBySlug(slug: string) {