UI: warm daylight design system (Tailwind v4 @theme palette, gh-* component classes, watercolor grain, Zen Maru Gothic + Klee One fonts), animated SSR-safe GhibliBackground (drifting clouds, meadow hills, soot sprites), and a full reskin of navbar, connect button, dapp page, loan cards, settings modal, and readme. Fixes the bg-white-on-dark loan-card inconsistency. Web3/business logic untouched. Docs: converted docs/ into an Obsidian vault (frontmatter, [[wikilinks]], callouts, Home MOC, folders Architecture/Operations/Audits) and added a full-project audit note (Project Audit 2026-06). Redacted a real leaked Schedy key value from the security audit example (rotate it at Schedy). Also commits the previously-untracked server layer: app/api (cron + tasks routes) and lib (redis, ssrf-guard, task-store). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { useAccount } from 'wagmi';
|
|
import { formatAddress } from '@/utils/format';
|
|
|
|
export function ConnectButton() {
|
|
const { address, isConnected } = useAccount();
|
|
|
|
const handleConnect = () => {
|
|
try {
|
|
// Minimal connect without WalletConnect modal
|
|
if (typeof window !== 'undefined' && (window as any).ethereum?.request) {
|
|
(window as any).ethereum.request({ method: 'eth_requestAccounts' });
|
|
}
|
|
} catch {}
|
|
};
|
|
|
|
if (isConnected && address) {
|
|
return (
|
|
<div className="inline-flex items-center gap-2 rounded-full border border-line bg-cloud/80 px-3 py-1.5 text-sm font-medium text-forest-deep">
|
|
<span className="h-2 w-2 rounded-full bg-forest animate-breathe" aria-hidden />
|
|
{formatAddress(address)}
|
|
{/* Disconnect can be done from the wallet UI; no WalletConnect here */}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<button
|
|
onClick={handleConnect}
|
|
className="gh-btn gh-btn-primary text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-deep"
|
|
>
|
|
🍃 Connect Wallet
|
|
</button>
|
|
);
|
|
}
|