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({ />
-
- -