From dce214a7ebec67aad0177ce6366b01fb908ec41d Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Fri, 28 Aug 2026 09:20:31 +0100 Subject: [PATCH] refactor(desktop): split onboarding preview journey Signed-off-by: kenny lopez --- .../onboarding/ui/OnboardingPreviewApp.tsx | 90 +------------------ .../ui/OnboardingPreviewJourney.tsx | 90 +++++++++++++++++++ 2 files changed, 91 insertions(+), 89 deletions(-) diff --git a/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx b/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx index 8809cccb34..adebf04e85 100644 --- a/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx +++ b/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx @@ -37,6 +37,7 @@ import { CommunityProfilePreview, type CommunityPreviewRoute, DefaultConfigPreview, + PasswordReset, StarterTeamPreview, WelcomeChannelPreview, } from "./OnboardingPreviewJourney"; @@ -617,95 +618,6 @@ function EmailSignIn({ ); } -function PasswordReset({ - initialEmail, - onBack, - total, -}: { - initialEmail: string; - onBack: () => void; - total: number; -}) { - const [email, setEmail] = React.useState(initialEmail); - const [submitted, setSubmitted] = React.useState(false); - - if (submitted) { - return ( - - -

- Check your email -

-

- Use the link we sent to {email.trim()} to reset your password. -

-
-
- ); - } - - return ( - - -

- Reset your password -

-

- Enter your email address and we'll send you a link to reset your - password. -

-
{ - event.preventDefault(); - if (email.trim()) setSubmitted(true); - }} - > - - setEmail(event.target.value)} - placeholder="Enter your email address" - type="email" - value={email} - /> - - - -
-
-
- ); -} - function KeySignIn({ onBack, onContinue, diff --git a/desktop/src/features/onboarding/ui/OnboardingPreviewJourney.tsx b/desktop/src/features/onboarding/ui/OnboardingPreviewJourney.tsx index 0d9ac5b6ae..a08f04078b 100644 --- a/desktop/src/features/onboarding/ui/OnboardingPreviewJourney.tsx +++ b/desktop/src/features/onboarding/ui/OnboardingPreviewJourney.tsx @@ -5,6 +5,7 @@ import { HostedCommunityOnboarding } from "@/features/communities/ui/HostedCommu import { pubkeyToNpub } from "@/shared/lib/nostrUtils"; import { Button } from "@/shared/ui/button"; import { Card } from "@/shared/ui/card"; +import { Input } from "@/shared/ui/input"; import { InviteRedeemForm } from "./InviteRedeemForm"; import { CommunityProfileStage } from "./CommunityProfileStage"; import { DownloadKeyStep } from "./DownloadKeyStep"; @@ -52,6 +53,95 @@ export function BackupPasswordPreview({ ); } +export function PasswordReset({ + initialEmail, + onBack, + total, +}: { + initialEmail: string; + onBack: () => void; + total: number; +}) { + const [email, setEmail] = React.useState(initialEmail); + const [submitted, setSubmitted] = React.useState(false); + + if (submitted) { + return ( + + +

+ Check your email +

+

+ Use the link we sent to {email.trim()} to reset your password. +

+
+
+ ); + } + + return ( + + +

+ Reset your password +

+

+ Enter your email address and we'll send you a link to reset your + password. +

+
{ + event.preventDefault(); + if (email.trim()) setSubmitted(true); + }} + > + + setEmail(event.target.value)} + placeholder="Enter your email address" + type="email" + value={email} + /> + + + +
+
+
+ ); +} + export function DefaultConfigPreview({ onBack, onNext,