From 35bffb0ac59c8fb489850999b3b1c098b79b4b9e Mon Sep 17 00:00:00 2001 From: morgmart <98432065+morgmart@users.noreply.github.com> Date: Tue, 21 Jul 2026 09:14:15 -0700 Subject: [PATCH] Restore npub copy option for private community joins --- .../features/communities/ui/WelcomeSetup.tsx | 62 ++++++++++++++++++- desktop/tests/e2e/onboarding.spec.ts | 5 ++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/communities/ui/WelcomeSetup.tsx b/desktop/src/features/communities/ui/WelcomeSetup.tsx index 964e105f8f..bde1458222 100644 --- a/desktop/src/features/communities/ui/WelcomeSetup.tsx +++ b/desktop/src/features/communities/ui/WelcomeSetup.tsx @@ -1,4 +1,5 @@ import * as React from "react"; +import { Check, Copy } from "lucide-react"; import { HostedCommunityOnboarding } from "@/features/communities/ui/HostedCommunityOnboarding"; import { useCommunityOnboarding } from "@/features/onboarding/communityOnboarding"; @@ -12,6 +13,9 @@ import { type OnboardingTransitionDirection, OnboardingSlideTransition, } from "@/features/onboarding/ui/OnboardingSlideTransition"; +import { useIdentityQuery } from "@/shared/api/hooks"; +import { writeTextToClipboard } from "@/shared/lib/clipboard"; +import { pubkeyToNpub } from "@/shared/lib/nostrUtils"; import { useSystemColorScheme } from "@/shared/theme/useSystemColorScheme"; import { Button } from "@/shared/ui/button"; import { Card } from "@/shared/ui/card"; @@ -41,8 +45,18 @@ export function WelcomeSetup({ // we only navigate to the hosted stage once sign-in completes, so the page // behind the modal never changes out from under the user. const [isHostedSignInOpen, setIsHostedSignInOpen] = React.useState(false); + const [copiedNpub, setCopiedNpub] = React.useState(false); const communityOnboarding = useCommunityOnboarding(); + const identityQuery = useIdentityQuery(); const systemColorScheme = useSystemColorScheme(); + const npub = identityQuery.data?.pubkey + ? pubkeyToNpub(identityQuery.data.pubkey) + : ""; + const npubError = identityQuery.error + ? identityQuery.error instanceof Error + ? identityQuery.error.message + : "Could not load your public key." + : null; const showPage = React.useCallback( (nextPage: WelcomeSetupPage, direction?: OnboardingTransitionDirection) => { @@ -243,7 +257,7 @@ export function WelcomeSetup({ : "Enter the invite link or community URL you received."}
-+ Joining a private community? +
++ Some communities need the owner to add you before you can + join. Copy your public ID and send it to the community + owner. +
+
+ {npub || "Loading…"}
+
+
+ + {npubError} +
+ ) : null} +