diff --git a/desktop/src/features/onboarding/ui/KeySignInPreview.tsx b/desktop/src/features/onboarding/ui/KeySignInPreview.tsx new file mode 100644 index 0000000000..f0f0465c9c --- /dev/null +++ b/desktop/src/features/onboarding/ui/KeySignInPreview.tsx @@ -0,0 +1,143 @@ +import * as React from "react"; + +import { + Dialog, + DialogContent, + DialogDescription, + DialogTitle, +} from "@/shared/ui/dialog"; +import { StyledQrCode } from "@/shared/ui/styled-qr-code"; +import { NostrKeyImportForm } from "./NostrKeyImportForm"; +import { ONBOARDING_INK_ICON_CLASS } from "./OnboardingChrome"; +import { OnboardingPreviewStep } from "./OnboardingPreviewShell"; +import { OnboardingSlideTransition } from "./OnboardingSlideTransition"; + +export function KeySignInPreview({ + onBack, + onContinue, + total, +}: { + onBack: () => void; + onContinue: () => void; + total: number; +}) { + const [keyImportDialog, setKeyImportDialog] = React.useState< + "backup" | "phone" | null + >(null); + + return ( + + + + Enter your private key + + + + Paste your private key to sign in to Buzz. You can also use a{" "} + setKeyImportDialog("backup")} + type="button" + > + backup file + + , or{" "} + setKeyImportDialog("phone")} + type="button" + > + recover from your phone + + . + + + + onContinue()} + previewMode + showBack={false} + variant="spotlight" + /> + + { + if (!open) setKeyImportDialog(null); + }} + open={keyImportDialog === "backup"} + > + + + + Restore from a backup file + + + Choose the encrypted backup file you saved from Buzz. + + setKeyImportDialog(null)} + onImport={async () => { + setKeyImportDialog(null); + onContinue(); + }} + previewMode + showBack={false} + variant="spotlight" + /> + + + + { + if (!open) setKeyImportDialog(null); + }} + open={keyImportDialog === "phone"} + > + + + + Scan to sign in + + + Scan this code with a device where you’re currently signed in to + Buzz. + + + + + + + + + + ); +} diff --git a/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx b/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx index adebf04e85..d22b70cfac 100644 --- a/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx +++ b/desktop/src/features/onboarding/ui/OnboardingPreviewApp.tsx @@ -19,8 +19,8 @@ import { useEncryptedBackupSession, } from "./EncryptedBackupCreator"; import { JoinPolicyNotice } from "./JoinPolicyNotice"; +import { KeySignInPreview } from "./KeySignInPreview"; import { LandingBees } from "./LandingBees"; -import { NostrKeyImportForm } from "./NostrKeyImportForm"; import { ONBOARDING_LANDING_CTA_CLASS, ONBOARDING_PRIMARY_CTA_CLASS, @@ -618,46 +618,6 @@ function EmailSignIn({ ); } -function KeySignIn({ - onBack, - onContinue, - total, -}: { - onBack: () => void; - onContinue: () => void; - total: number; -}) { - return ( - - - - Enter your private key - - - Paste your private key to sign in to Buzz. You can also use a backup - file, or recover from your phone. - - - onContinue()} - previewMode - showBack={false} - variant="spotlight" - /> - - - - ); -} - export function OnboardingPreviewApp() { const [run, setRun] = React.useState(0); const [variant, setVariant] = React.useState("v3"); @@ -801,7 +761,7 @@ export function OnboardingPreviewApp() { ); } else if (page === "sign-in-key") { content = ( - setPage("sign-in")} onContinue={() => continueFromAccount("sign-in-key")} total={journey.totalSteps}
+ Paste your private key to sign in to Buzz. You can also use a{" "} + setKeyImportDialog("backup")} + type="button" + > + backup file + + , or{" "} + setKeyImportDialog("phone")} + type="button" + > + recover from your phone + + . +
- Paste your private key to sign in to Buzz. You can also use a backup - file, or recover from your phone. -