@@ -5,7 +5,6 @@ import { useCommunityOnboarding } from "@/features/onboarding/communityOnboardin
55import { normalizeRelayUrl } from "@/features/communities/relayProbe" ;
66import { InviteRedeemForm } from "@/features/onboarding/ui/InviteRedeemForm" ;
77import {
8- ONBOARDING_KEY_FRAME_CLASS ,
98 ONBOARDING_KEY_ROW_CLASS ,
109 ONBOARDING_KEY_TEXT_CLASS ,
1110} from "@/features/onboarding/ui/NsecMaskedDisplay" ;
@@ -20,10 +19,14 @@ import {
2019import { getIdentity } from "@/shared/api/tauriIdentity" ;
2120import { pubkeyToNpub } from "@/shared/lib/nostrUtils" ;
2221import { Button } from "@/shared/ui/button" ;
22+ import { Card } from "@/shared/ui/card" ;
2323import { Input } from "@/shared/ui/input" ;
2424import { StartupWindowDragRegion } from "@/shared/ui/StartupWindowDragRegion" ;
2525import { useSystemColorScheme } from "@/shared/theme/useSystemColorScheme" ;
26- import { OnboardingChrome } from "@/features/onboarding/ui/OnboardingChrome" ;
26+ import {
27+ ONBOARDING_PRIMARY_CTA_CLASS ,
28+ OnboardingChrome ,
29+ } from "@/features/onboarding/ui/OnboardingChrome" ;
2730import { HostedCommunityOnboarding } from "@/features/communities/ui/HostedCommunityOnboarding" ;
2831import { writeTextToClipboard } from "@/shared/lib/clipboard" ;
2932
@@ -37,7 +40,16 @@ type WelcomeSetupProps = {
3740} ;
3841
3942const COMMUNITY_OPTION_CARD_CLASS =
40- "flex min-h-24 w-full max-w-[352px] items-center justify-center rounded-xl bg-white/75 px-6 py-4 text-center text-sm font-normal leading-6 text-foreground transition-colors duration-150 ease-out hover:bg-white/85 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-foreground/35" ;
43+ "w-full max-w-[320px] items-center px-6 py-4 text-center text-sm font-normal leading-6 text-foreground [--buzz-card-textured-min-height:88px] transition-[filter] duration-150 ease-out hover:brightness-[0.98] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-foreground/35" ;
44+ const WIDE_TEXTURE_CARD_CLASS =
45+ "relative left-1/2 w-[min(calc(100%+10rem),calc(100vw-2rem))] max-w-[1040px] -translate-x-1/2 px-8 py-6 [--buzz-card-textured-min-height:192px]" ;
46+ const WIDE_TEXTURE_CONTENT_CLASS = "mx-auto w-full max-w-[840px]" ;
47+ const HORIZONTAL_INPUT_OVERFLOW_FADE = {
48+ WebkitMaskImage :
49+ "linear-gradient(to right, transparent, black 2rem, black calc(100% - 2rem), transparent)" ,
50+ maskImage :
51+ "linear-gradient(to right, transparent, black 2rem, black calc(100% - 2rem), transparent)" ,
52+ } ;
4153
4254export function WelcomeSetup ( {
4355 initialPage = "welcome" ,
@@ -111,16 +123,17 @@ export function WelcomeSetup({
111123
112124 return (
113125 < div
114- className = "buzz-onboarding-neutral-theme buzz-startup-shell flex min- h-dvh items-start justify-center overflow-y-auto bg-background px-4 pb-36 pt-[106px] text-foreground"
126+ className = "buzz-onboarding-neutral-theme buzz-startup-shell flex h-dvh items-start justify-center overflow-y-auto bg-background px-4 pb-36 pt-[106px] text-foreground"
115127 data-system-color-scheme = { systemColorScheme }
116128 >
117129 < StartupWindowDragRegion />
118130 < OnboardingChrome current = { 5 } />
119131 < OnboardingFooterProvider >
120- < div className = "relative flex w-full max-w-4xl flex-col items-center text-center" >
132+ < div className = "relative flex min-h-0 w-full max-w-[920px] flex-1 flex-col items-center text-center" >
121133 { page === "welcome" ? (
122134 < OnboardingSlideTransition
123- className = "flex w-full flex-col items-center text-center"
135+ className = "flex h-full min-h-0 w-full flex-col items-center text-center"
136+ containerClassName = "h-full min-h-0 [&>.buzz-onboarding-transition-line]:h-full"
124137 direction = { transitionDirection }
125138 effect = { welcomeEffect }
126139 transitionKey = { `welcome-${ welcomeEffect } -${ transitionDirection } ` }
@@ -134,30 +147,36 @@ export function WelcomeSetup({
134147 link, you can open it directly to continue setup.
135148 </ p >
136149 </ div >
137- < div className = "mt-28 flex w-full flex-col items-center gap-6" >
138- < button
150+ < div className = "flex w-full flex-1 translate-y-16 flex-col items-center justify-center gap-20 py-8" >
151+ < Card
152+ asChild
139153 className = { COMMUNITY_OPTION_CARD_CLASS }
140- onClick = { ( ) => showPage ( "join" ) }
141- type = "button"
154+ variant = "textured"
142155 >
143- Add me to a community
144- </ button >
145- < button
156+ < button onClick = { ( ) => showPage ( "join" ) } type = "button" >
157+ Add me to a community
158+ </ button >
159+ </ Card >
160+ < Card
161+ asChild
146162 className = { COMMUNITY_OPTION_CARD_CLASS }
147- onClick = { ( ) => showPage ( "invite" ) }
148- type = "button"
163+ variant = "textured"
149164 >
150- I have an invite link
151- </ button >
152- < button
165+ < button onClick = { ( ) => showPage ( "invite" ) } type = "button" >
166+ I have an invite link
167+ </ button >
168+ </ Card >
169+ < Card
170+ asChild
153171 className = { COMMUNITY_OPTION_CARD_CLASS }
154- onClick = { ( ) => showPage ( "owned" ) }
155- type = "button"
172+ variant = "textured"
156173 >
157- < span className = "max-w-52" >
158- Create or connect to my own community
159- </ span >
160- </ button >
174+ < button onClick = { ( ) => showPage ( "owned" ) } type = "button" >
175+ < span className = "max-w-52" >
176+ Create or connect to my own community
177+ </ span >
178+ </ button >
179+ </ Card >
161180 </ div >
162181 < OnboardingFooter >
163182 < Button
@@ -192,58 +211,61 @@ export function WelcomeSetup({
192211 >
193212 Request access to a community
194213 </ h1 >
195- < p className = "mx-auto mt-3 max-w-[430px] text-sm leading-6" >
196- Ask the community host to send you an invite link or add you
197- directly using your public key.
198- </ p >
199214 </ div >
200- < div className = "flex w-full flex-1 items-center justify-center pb-2 pt-6" >
201- < div className = "w-full max-w-4xl space-y-16" >
202- < section aria-labelledby = "welcome-join-key-step" >
215+ < div className = "flex w-full flex-1 items-center justify-center" >
216+ < div className = "w-full max-w-[920px] space-y-16" >
217+ < section
218+ aria-labelledby = "welcome-join-key-step"
219+ className = "translate-y-12"
220+ >
203221 < h2
204- className = "mb-4 text-sm font-normal"
222+ className = "relative z-10 mb-8 text-sm font-normal"
205223 id = "welcome-join-key-step"
206224 >
207- Step 1: Share your public key
225+ Step 1: Ask your community host to send you an invite link
226+ or add you using your public key
208227 </ h2 >
209- < div
210- className = { ONBOARDING_KEY_FRAME_CLASS }
228+ < Card
229+ className = { WIDE_TEXTURE_CARD_CLASS }
211230 data-testid = "welcome-join-npub-frame"
231+ variant = "textured"
212232 >
213- < div className = { ONBOARDING_KEY_ROW_CLASS } >
214- < div className = "min-w-0 flex-1" >
215- < code
216- className = { `${ ONBOARDING_KEY_TEXT_CLASS } block` }
217- data-testid = "welcome-join-npub"
233+ < div className = { WIDE_TEXTURE_CONTENT_CLASS } >
234+ < div className = { ONBOARDING_KEY_ROW_CLASS } >
235+ < div className = "min-w-0 flex-1" >
236+ < code
237+ className = { `${ ONBOARDING_KEY_TEXT_CLASS } block` }
238+ data-testid = "welcome-join-npub"
239+ >
240+ { npub || "Loading…" }
241+ </ code >
242+ </ div >
243+ < Button
244+ aria-label = "Copy npub"
245+ className = "h-10 w-10 shrink-0 text-[var(--buzz-onboarding-backup-ink)] hover:bg-transparent hover:text-foreground"
246+ disabled = { ! npub }
247+ onClick = { ( ) => {
248+ void writeTextToClipboard ( npub ) . then ( ( ) => {
249+ setCopied ( true ) ;
250+ window . setTimeout ( ( ) => setCopied ( false ) , 1500 ) ;
251+ } ) ;
252+ } }
253+ size = "icon"
254+ type = "button"
255+ variant = "ghost"
218256 >
219- { npub || "Loading…" }
220- </ code >
257+ { copied ? (
258+ < Check
259+ className = "h-6 w-6 text-primary"
260+ aria-hidden = "true"
261+ />
262+ ) : (
263+ < Copy className = "h-6 w-6" aria-hidden = "true" />
264+ ) }
265+ </ Button >
221266 </ div >
222- < Button
223- aria-label = "Copy npub"
224- className = "h-10 w-10 shrink-0 text-[var(--buzz-onboarding-backup-ink)] hover:bg-transparent hover:text-foreground"
225- disabled = { ! npub }
226- onClick = { ( ) => {
227- void writeTextToClipboard ( npub ) . then ( ( ) => {
228- setCopied ( true ) ;
229- window . setTimeout ( ( ) => setCopied ( false ) , 1500 ) ;
230- } ) ;
231- } }
232- size = "icon"
233- type = "button"
234- variant = "ghost"
235- >
236- { copied ? (
237- < Check
238- className = "h-6 w-6 text-primary"
239- aria-hidden = "true"
240- />
241- ) : (
242- < Copy className = "h-6 w-6" aria-hidden = "true" />
243- ) }
244- </ Button >
245267 </ div >
246- </ div >
268+ </ Card >
247269 { identityError ? (
248270 < p className = "mt-4 text-sm text-destructive" >
249271 { identityError }
@@ -257,27 +279,37 @@ export function WelcomeSetup({
257279 onSubmit = { handleJoin }
258280 >
259281 < h2
260- className = "mb-4 text-sm font-normal"
282+ className = "relative z-10 mb-8 text-sm font-normal"
261283 id = "welcome-join-url-step"
262284 >
263285 Step 2: Paste in your community URL
264286 </ h2 >
265- < Input
266- aria-label = "Community URL"
267- autoCapitalize = "none"
268- autoCorrect = "off"
269- className = "h-auto rounded-xl border-0 bg-white/50 px-8 py-7 text-center font-mono !text-4xl text-[color:var(--buzz-onboarding-backup-ink)] shadow-none placeholder:text-[color:var(--buzz-onboarding-backup-ink)] placeholder:opacity-10 focus-visible:ring-1 focus-visible:ring-[rgb(113_113_6_/_0.5)]"
270- data-testid = "welcome-join-community-url"
271- id = "welcome-join-community-url"
272- onChange = { ( event ) => {
273- setRelayUrl ( event . target . value ) ;
274- setRelayUrlError ( null ) ;
275- } }
276- placeholder = "Enter community URL"
277- spellCheck = { false }
278- type = "url"
279- value = { relayUrl }
280- />
287+ < Card
288+ className = { `${ WIDE_TEXTURE_CARD_CLASS } [--buzz-card-textured-min-height:128px]` }
289+ variant = "textured"
290+ >
291+ < div
292+ className = { WIDE_TEXTURE_CONTENT_CLASS }
293+ style = { HORIZONTAL_INPUT_OVERFLOW_FADE }
294+ >
295+ < Input
296+ aria-label = "Community URL"
297+ autoCapitalize = "none"
298+ autoCorrect = "off"
299+ className = "h-auto rounded-none border-0 bg-transparent p-0 text-center font-mono !text-4xl text-[color:var(--buzz-onboarding-backup-ink)] shadow-none placeholder:text-[color:var(--buzz-onboarding-backup-ink)] placeholder:opacity-10 focus-visible:ring-0"
300+ data-testid = "welcome-join-community-url"
301+ id = "welcome-join-community-url"
302+ onChange = { ( event ) => {
303+ setRelayUrl ( event . target . value ) ;
304+ setRelayUrlError ( null ) ;
305+ } }
306+ placeholder = "Enter community URL"
307+ spellCheck = { false }
308+ type = "url"
309+ value = { relayUrl }
310+ />
311+ </ div >
312+ </ Card >
281313 { relayUrlError ? (
282314 < p className = "mt-3 text-sm text-destructive" >
283315 { relayUrlError }
@@ -288,7 +320,7 @@ export function WelcomeSetup({
288320 </ div >
289321 < OnboardingFooter >
290322 < Button
291- className = "h-10 w-44 rounded-full"
323+ className = { ONBOARDING_PRIMARY_CTA_CLASS }
292324 disabled = { ! relayUrl . trim ( ) }
293325 form = "welcome-join-form"
294326 type = "submit"
@@ -297,7 +329,7 @@ export function WelcomeSetup({
297329 < span className = "sr-only" > Join community</ span >
298330 </ Button >
299331 < Button
300- className = "h-10 w-44 rounded-full bg-foreground/10 hover:bg-foreground/15"
332+ className = "h-9 rounded-full bg-foreground/10 px-6 hover:bg-foreground/15"
301333 onClick = { ( ) => showPage ( "welcome" ) }
302334 type = "button"
303335 variant = "ghost"
@@ -321,7 +353,7 @@ export function WelcomeSetup({
321353 continue setup.
322354 </ p >
323355 </ div >
324- < div className = "flex w-full flex-1 items-center justify-center pb-4 pt-12 " >
356+ < div className = "flex w-full flex-1 items-center justify-center" >
325357 < InviteRedeemForm
326358 error = { null }
327359 isRedeeming = { false }
0 commit comments