From c845f7286bacc0d794ccb8bf7da02a7d219f4bae Mon Sep 17 00:00:00 2001 From: Chad Curtis Date: Sat, 30 May 2026 20:14:56 -0500 Subject: [PATCH] onboarding: hide bio behind Advanced toggle; show profile step first for new campaign creators --- src/components/OnboardingGate.tsx | 69 +++++++++++++++++++--------- src/contexts/OnboardingProvider.tsx | 4 +- src/contexts/onboardingContextDef.ts | 12 +++++ src/locales/ar.json | 1 + src/locales/en.json | 1 + src/locales/es.json | 1 + src/locales/fa.json | 1 + src/locales/fr.json | 1 + src/locales/hi.json | 1 + src/locales/id.json | 1 + src/locales/km.json | 1 + src/locales/ps.json | 1 + src/locales/pt.json | 1 + src/locales/ru.json | 1 + src/locales/sn.json | 1 + src/locales/sw.json | 1 + src/locales/tr.json | 1 + src/locales/zh-Hant.json | 1 + src/locales/zh.json | 1 + src/pages/CreateCampaignPage.tsx | 32 +++++++++++-- 20 files changed, 108 insertions(+), 25 deletions(-) diff --git a/src/components/OnboardingGate.tsx b/src/components/OnboardingGate.tsx index c0693a32..efb3a061 100644 --- a/src/components/OnboardingGate.tsx +++ b/src/components/OnboardingGate.tsx @@ -12,6 +12,7 @@ import { ArrowLeft, ArrowRight, Bitcoin, + ChevronDown, Download, Eye, EyeOff, @@ -92,7 +93,7 @@ export function OnboardingGate({ children }: { children: ReactNode }) { * per-flow state resets cleanly between sessions. */ function CaptiveOverlay() { const { t } = useTranslation(); - const { cancel, role: contextRole, setRole: setContextRole } = useOnboarding(); + const { cancel, role: contextRole, setRole: setContextRole, skipToProfile } = useOnboarding(); const navigate = useNavigate(); const { toast } = useToast(); const login = useLoginActions(); @@ -100,13 +101,16 @@ function CaptiveOverlay() { const { mutateAsync: publishEvent, isPending: isPublishingProfile } = useNostrPublish(); const { mutateAsync: uploadFile, isPending: isUploadingAvatar } = useUploadFile(); - // Decide the entry step. Already-authenticated users (e.g. a CTA called - // startSignup() on a logged-in surface to walk them to the role picker) - // skip keygen / secure / profile and land on `role` directly. + // Decide the entry step. + // - Already-authenticated users normally land on `role` directly. + // - If `skipToProfile` is set (e.g. campaign creation for a user with no + // profile), they land on `profile` first; after finishing we navigate + // straight to the role destination without showing the role picker. const initialStep: Step = useMemo(() => { + if (user && skipToProfile) return 'profile'; if (user) return 'role'; return 'keygen'; - }, [user]); + }, [user, skipToProfile]); const [step, setStep] = useState(initialStep); @@ -227,10 +231,19 @@ function CaptiveOverlay() { variant: 'destructive', }); } finally { - goTo('role'); + // When the overlay was opened with skipToProfile (e.g. from + // /campaigns/new for a user without a profile), skip the role + // picker and navigate directly to the pre-seeded role destination. + if (skipToProfile && contextRole) { + cancel(); + if (contextRole === 'creator') navigate('/campaigns/new'); + else navigate('/campaigns'); + } else { + goTo('role'); + } } }, - [profileData, publishEvent, toast, t, goTo], + [profileData, publishEvent, toast, t, goTo, skipToProfile, contextRole, cancel, navigate], ); // Step renderer ----------------------------------------------------------- @@ -577,6 +590,7 @@ function ProfileStep({ onSkip, }: ProfileStepProps) { const { t } = useTranslation(); + const [showAdvanced, setShowAdvanced] = useState(false); return (
@@ -597,20 +611,6 @@ function ProfileStep({ />
-
- -