Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 23 additions & 30 deletions src/components/ConnectWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export function ConnectWallet({ onNavigate, compact }: ConnectWalletProps = {}) {
const { address, isConnected } = useAccount();
const { connect, connectors } = useConnect();
const { disconnect } = useDisconnect();

Check warning on line 20 in src/components/ConnectWallet.tsx

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'disconnect' is assigned a value but never used
const autoConnectAttempted = useRef(false);
const [inMiniApp, setInMiniApp] = useState(false);
const { profile } = useConnectedIdentity();
Expand Down Expand Up @@ -45,15 +45,15 @@

// Connected state
if (isConnected && address) {
const shortAddr = address.slice(0, 6);
const displayAddr = truncateAddress(address);

// Compact mode: PFP + short identifier for mobile top nav
// Compact mode: bordered box for mobile top nav (matches hamburger box height)
if (compact) {
return (
<Link
href={`/profile/${address}`}
onClick={onNavigate}
className="text-accent inline-flex items-center gap-1 text-xs font-medium hover:opacity-80 transition-opacity"
className="border-border text-accent inline-flex items-center gap-1.5 rounded border px-2 py-1 text-xs font-medium hover:opacity-80 transition-opacity"
>
{profile?.pfpUrl && (
// eslint-disable-next-line @next/next/no-img-element
Expand All @@ -67,37 +67,30 @@
)}
{profile
? `@${profile.username.length > 10 ? profile.username.slice(0, 10) + "…" : profile.username}`
: shortAddr}
: displayAddr}
</Link>
);
}

// Full mode: PFP + username + shortened address (no disconnect)
// Full mode: pill with PFP + @username or truncated address
return (
<div className="border-border flex items-center gap-3 rounded border px-3 py-2 text-sm">
<Link
href={`/profile/${address}`}
onClick={onNavigate}
className="text-accent inline-flex items-center gap-1.5 font-medium hover:opacity-80 transition-opacity"
>
{profile?.pfpUrl && (
// eslint-disable-next-line @next/next/no-img-element
<img
src={profile.pfpUrl}
alt=""
width={16}
height={16}
className="rounded-full"
/>
)}
{profile ? `@${profile.username}` : shortAddr}
</Link>
{profile && (
<span className="text-muted text-[10px] font-mono">
{shortAddr}
</span>
<Link
href={`/profile/${address}`}
onClick={onNavigate}
className="border-border text-accent inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium hover:opacity-80 transition-opacity"
>
{profile?.pfpUrl && (
// eslint-disable-next-line @next/next/no-img-element
<img
src={profile.pfpUrl}
alt=""
width={18}
height={18}
className="rounded-full"
/>
)}
</div>
{profile ? `@${profile.username}` : displayAddr}
</Link>
);
}

Expand All @@ -123,8 +116,8 @@
type="button"
className={
compact
? "border-accent text-accent hover:bg-accent hover:text-background rounded border px-2.5 py-1 text-xs transition-colors"
: "border-accent text-accent hover:bg-accent hover:text-background rounded border px-4 py-2 text-sm transition-colors"
? "border-border text-accent hover:bg-accent hover:text-background rounded border px-2 py-1 text-xs font-medium transition-colors"
: "border-border text-accent hover:bg-accent hover:text-background rounded-full border px-3 py-1 text-xs font-medium transition-colors"
}
>
{compact ? "Connect" : "connect wallet"}
Expand Down
10 changes: 5 additions & 5 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ export function NavBar() {
</div>

{/* Right side: wallet + mobile toggle */}
<div className="flex items-center gap-2">
{/* Desktop: full ConnectWallet */}
<div className="flex items-center gap-1.5">
{/* Desktop: pill ConnectWallet */}
<div className="hidden md:block">
<ConnectWallet />
</div>
{/* Mobile: compact Connect button / PFP in top nav */}
{/* Mobile: matched-height boxes — PFP box + hamburger box */}
<div className="md:hidden">
<ConnectWallet compact />
</div>
<button
onClick={() => setMobileOpen(!mobileOpen)}
className="text-muted hover:text-foreground p-1 transition-colors md:hidden"
className="border-border text-muted hover:text-foreground flex items-center justify-center rounded border px-2 py-1 transition-colors md:hidden"
aria-label="Toggle menu"
aria-expanded={mobileOpen}
>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
{mobileOpen ? (
<>
<line x1="18" y1="6" x2="6" y2="18" />
Expand Down
Loading