diff --git a/src/pages/NIP19Page.tsx b/src/pages/NIP19Page.tsx index f12bb99..cfe4ee7 100644 --- a/src/pages/NIP19Page.tsx +++ b/src/pages/NIP19Page.tsx @@ -60,8 +60,9 @@ function profileEventCreatedAt(createdAt: number | undefined): string | undefine return new Date(createdAt * 1000).toLocaleDateString(undefined, { year: 'numeric', month: 'short' }); } -/** A compact stat pill for the at-a-glance strip. Clickable when `onClick` is - * provided (jumps to the matching section); shows disabled/inert when empty. */ +/** A stat cell for the at-a-glance grid. Clickable (jumps to its section) when + * it has a non-zero value; shows an inert, muted state at zero so a brand-new + * profile reads as "nothing yet" rather than broken. */ function StatPill({ value, label, @@ -78,37 +79,49 @@ function StatPill({ onClick?: () => void; }) { const interactive = !!onClick && value > 0; + const empty = !loading && value === 0; + const inner = ( -
- {loading ? ( - - ) : ( -

- {icon} - {value} + <> + + {icon} + +

+ {loading ? ( + + ) : ( +

+ {value} +

+ )} +

+ {label}

- )} -

- {label} -

-
+
+ ); - const base = 'flex items-center gap-2.5 rounded-xl border px-3.5 py-2.5 min-w-[84px] transition-all'; + const base = 'group flex items-center gap-3 rounded-2xl border p-3 transition-all'; if (interactive) { return ( ); } - return
{inner}
; + return
{inner}
; } function ProfilePage({ pubkey }: { pubkey: string }) { @@ -323,25 +336,31 @@ function ProfilePage({ pubkey }: { pubkey: string }) { {/* ── At-a-glance stats strip ── */} -
- scrollToSection('section-spots')} /> - scrollToSection('section-shops')} /> - scrollToSection('section-crews')} /> - scrollToSection('section-stash')} /> - {(riderStats?.zapsReceived ?? 0) > 0 && ( - } /> - )} - {memberSince && ( -
- -
-

Member since

-

{memberSince}

-
-
- )} +
+ } loading={spotsLoading} onClick={() => scrollToSection('section-spots')} /> + } loading={shopsLoading} onClick={() => scrollToSection('section-shops')} /> + } loading={crewsLoading} onClick={() => scrollToSection('section-crews')} /> + } loading={publicStashLoading} onClick={() => scrollToSection('section-stash')} />
+ {/* Secondary meta line: zaps received + member since */} + {(memberSince || (riderStats?.zapsReceived ?? 0) > 0) && ( +
+ {(riderStats?.zapsReceived ?? 0) > 0 && ( + + + {riderStats!.zapsReceived} zaps received + + )} + {memberSince && ( + + + Member since {memberSince} + + )} +
+ )} + {/* Profile Info */}
{/* Main Content */}