@@ -4,6 +4,7 @@ import { Check, KeyRound } from "lucide-react";
44import { cn } from "@/shared/lib/cn" ;
55import { nsecToNpub } from "@/shared/lib/nostrUtils" ;
66import { Button } from "@/shared/ui/button" ;
7+ import { Card } from "@/shared/ui/card" ;
78import { Input } from "@/shared/ui/input" ;
89import { Spinner } from "@/shared/ui/spinner" ;
910import { ONBOARDING_PRIMARY_CTA_CLASS } from "./OnboardingChrome" ;
@@ -127,36 +128,56 @@ export function NostrKeyImportForm({
127128 } }
128129 >
129130 < div className = "space-y-1.5 text-left" >
130- { variant === "spotlight" ? null : (
131- < label
132- className = "text-sm font-medium text-foreground"
133- htmlFor = "nostr-private-key"
131+ < label
132+ className = { cn (
133+ "text-sm font-medium text-foreground" ,
134+ variant === "spotlight" && "sr-only" ,
135+ ) }
136+ htmlFor = "nostr-private-key"
137+ >
138+ Private key
139+ </ label >
140+ { variant === "spotlight" ? (
141+ < Card
142+ className = "w-full px-8 py-12"
143+ data-testid = "nostr-import-card"
144+ variant = "textured"
134145 >
135- Private key
136- </ label >
146+ < Input
147+ autoComplete = "off"
148+ autoCorrect = "off"
149+ className = "h-[3.6875rem] rounded-none border-0 bg-transparent px-0 text-center font-mono !text-4xl shadow-none placeholder:text-foreground/30 focus-visible:ring-0"
150+ data-testid = "nostr-import-nsec-input"
151+ id = "nostr-private-key"
152+ onChange = { ( event ) => {
153+ setNsecInput ( event . target . value ) ;
154+ setImportError ( null ) ;
155+ } }
156+ placeholder = "Enter your key here"
157+ ref = { inputRef }
158+ spellCheck = { false }
159+ type = "password"
160+ value = { nsecInput }
161+ />
162+ </ Card >
163+ ) : (
164+ < Input
165+ autoComplete = "off"
166+ autoCorrect = "off"
167+ className = "h-10 bg-background"
168+ data-testid = "nostr-import-nsec-input"
169+ id = "nostr-private-key"
170+ onChange = { ( event ) => {
171+ setNsecInput ( event . target . value ) ;
172+ setImportError ( null ) ;
173+ } }
174+ placeholder = "nsec1..."
175+ ref = { inputRef }
176+ spellCheck = { false }
177+ type = "password"
178+ value = { nsecInput }
179+ />
137180 ) }
138- < Input
139- autoComplete = "off"
140- autoCorrect = "off"
141- className = {
142- variant === "spotlight"
143- ? "h-16 rounded-2xl border-0 bg-white/85 text-center font-mono !text-xl shadow-[0_0_70px_45px_rgba(255,255,255,0.85)] placeholder:text-foreground/30 focus-visible:ring-0"
144- : "h-10 bg-background"
145- }
146- data-testid = "nostr-import-nsec-input"
147- id = "nostr-private-key"
148- onChange = { ( event ) => {
149- setNsecInput ( event . target . value ) ;
150- setImportError ( null ) ;
151- } }
152- placeholder = {
153- variant === "spotlight" ? "Enter your key here" : "nsec1..."
154- }
155- ref = { inputRef }
156- spellCheck = { false }
157- type = "password"
158- value = { nsecInput }
159- />
160181 </ div >
161182
162183 { variant === "spotlight" ? null : (
@@ -244,32 +265,37 @@ export function NostrKeyImportForm({
244265 </ >
245266 ) }
246267
247- { previewNpub ? (
248- < div
249- className = "flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2 text-xs"
250- data-testid = "nostr-import-npub-preview"
251- >
252- < Check className = "mt-0.5 h-4 w-4 shrink-0 text-primary" />
253- < div className = "min-w-0 space-y-0.5" >
254- < p className = "font-medium text-foreground" >
255- This will use this Nostr identity:
256- </ p >
257- < p className = "break-all font-mono text-2xs text-muted-foreground" >
258- { previewNpub }
259- </ p >
268+ < div
269+ className = { cn ( "min-h-8" , variant === "spotlight" && "mt-6 text-center" ) }
270+ data-testid = "nostr-import-feedback"
271+ >
272+ { previewNpub ? (
273+ < div
274+ className = "flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2 text-xs"
275+ data-testid = "nostr-import-npub-preview"
276+ >
277+ < Check className = "mt-0.5 h-4 w-4 shrink-0 text-primary" />
278+ < div className = "min-w-0 space-y-0.5" >
279+ < p className = "font-medium text-foreground" >
280+ This will use this Nostr identity:
281+ </ p >
282+ < p className = "break-all font-mono text-2xs text-muted-foreground" >
283+ { previewNpub }
284+ </ p >
285+ </ div >
260286 </ div >
261- </ div >
262- ) : null }
287+ ) : null }
263288
264- { showInvalidHint && ! errorMessage ? (
265- < p className = "text-xs text-muted-foreground" >
266- Waiting for a valid nsec1 key.
267- </ p >
268- ) : null }
289+ { showInvalidHint && ! errorMessage ? (
290+ < p className = "text-xs text-muted-foreground" >
291+ Waiting for a valid nsec1 key.
292+ </ p >
293+ ) : null }
269294
270- { errorMessage ? (
271- < p className = "text-center text-sm text-destructive" > { errorMessage } </ p >
272- ) : null }
295+ { errorMessage ? (
296+ < p className = "text-center text-sm text-destructive" > { errorMessage } </ p >
297+ ) : null }
298+ </ div >
273299
274300 < OnboardingFooter >
275301 < Button
0 commit comments