diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index 7a71e3f1..2d8dcbe7 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -33,11 +33,13 @@ function EditableInput({ value, placeholder, onChange, + maxLength, className, }: { value: string; placeholder: string; onChange: (v: string) => void; + maxLength?: number; className?: string; }) { return ( @@ -45,6 +47,7 @@ function EditableInput({ type="text" value={value} placeholder={placeholder} + maxLength={maxLength} onChange={(e) => onChange(e.target.value)} className={cn(editableBase, 'w-full min-w-0 py-0.5', className)} /> @@ -150,6 +153,12 @@ interface ProfileCardProps { onRemoveBanner?: () => void; /** Show the banner area (default true). When false, only the avatar shows. */ showBanner?: boolean; + /** Show the avatar area (default true). */ + showAvatar?: boolean; + /** Placeholder for the editable name input. */ + namePlaceholder?: string; + /** Maximum length for the editable name input. */ + nameMaxLength?: number; /** Show NIP-05 row (default true) */ showNip05?: boolean; /** Show NIP-58 badge showcase row (default true). */ @@ -178,6 +187,9 @@ export function ProfileCard({ onRemoveAvatar, onRemoveBanner, showBanner = true, + showAvatar = true, + namePlaceholder = 'Your name', + nameMaxLength, showNip05 = true, showBadges = true, bioField = 'about', @@ -284,10 +296,10 @@ export function ProfileCard({ ))} {/* Profile info */} -
+
{/* Avatar */} -
+ {showAvatar &&
{editable ? (
)} -
+
} {/* Name */} {editable ? ( diff --git a/src/components/Wizard.tsx b/src/components/Wizard.tsx index 02ae9157..beff0c60 100644 --- a/src/components/Wizard.tsx +++ b/src/components/Wizard.tsx @@ -63,6 +63,8 @@ export interface WizardProps { launchNowLabel?: string; onSubmit: (e: FormEvent) => void; onClose: () => void; + /** Optional back action for step 1 when there is a meaningful previous flow. */ + onBackFromFirstStep?: () => void; } /** @@ -103,6 +105,7 @@ export function Wizard({ launchNowLabel, onSubmit, onClose, + onBackFromFirstStep, }: WizardProps) { const { t } = useTranslation(); const [step, setStep] = useState(1); @@ -124,6 +127,7 @@ export function Wizard({ const canSubmit = isTerminal ? !submitting && !isAdvancing : launchVisible && canAdvance && !submitting && !isAdvancing; + const backVisible = step > 1 || !!onBackFromFirstStep; const handleAdvance = async () => { if (submitting || isAdvancing || !canAdvance) return; @@ -169,12 +173,18 @@ export function Wizard({ {/* Top-left back. Mirrors the close button so the user can step - back through the wizard without scrolling to the footer. Only - rendered from step 2 onward — step 1's escape route is the X. */} - {step > 1 && ( + back through the wizard without scrolling to the footer. Step 1 + only renders it when the host provides an external back target. */} + {backVisible && (