Commit 5234db4
feat: add governance delegation writes (unlock-protocol#16324)
* feat: add governance delegation writes
* fix: pass tokenSymbol as prop to DelegateAccountPanel instead of reading from config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: thread tokenSymbol prop through to DelegateWalletPanel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: replace StateCard wallet-connect states with inline connect button
Show a simple "Connect wallet" button (using @unlock-protocol/ui Button)
when the user is not authenticated, matching the airdrops site UX pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: resolve ENS on mainnet and Basenames on Base
ENS names are registered on Ethereum mainnet; resolving them on Base
always fails. Use a mainnet JsonRpcProvider for ENS lookups and fall
back to a Base JsonRpcProvider for Basename resolution.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use shared staging Privy app ID from unlock-app as default
Falls back to the same staging Privy app used by unlock-app so wallet
connection works locally without setting NEXT_PUBLIC_PRIVY_APP_ID.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: match Privy UI config to unlock-app
Use the same loginMethods, embeddedWallets, appearance, and _render
settings as unlock-app. Remove the canConnect dead-code guard since
privyAppId now always has a fallback value.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use AddressInput for delegate target field
Replace the plain Input with AddressInput from @unlock-protocol/ui,
which includes a clear button, wallet icon, and built-in ENS/Basename
resolution with debounce. Submit path validates the already-resolved
address from the input's onChange callback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: replace custom app shell header with HeaderNav + wallet connect
Use HeaderNav from @unlock-protocol/ui with governance nav links.
Add GovernanceHeader client component showing a Connect button when
unauthenticated and an address/sign-out menu when connected.
Add disconnect() to useGovernanceWallet via Privy's useLogout hook.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Footer to governance app shell
Use the Footer component from @unlock-protocol/ui with governance-
relevant links (DAO, Forum, Snapshot, Docs, Roadmap, Blog).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add ConnectModal, TermsOfServiceModal, and fix header alignment
- ConnectModal: wraps Privy LoginModal with useConnectModal context
- TermsOfServiceModal: one-time ToS acceptance persisted in localStorage
- ConnectModalProvider: simple open/close state wired to Privy login()
- GovernanceHeader: use openConnectModal instead of calling login() directly
- GovernanceHeader: wrap HeaderNav in max-w-7xl container to fix full-width alignment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: mark AppShell as client component
Footer from @unlock-protocol/ui uses hooks without 'use client', which
causes a Next.js build error when imported from a server component.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: constrain footer width to match page layout
Wrap Footer in max-w-7xl container to match the header and main
content alignment.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove inline connect button from delegation panel
The header Connect button is the single entry point for wallet
connection. Remove the !authenticated branch with its Button, the
!address waiting StateCard, and all related hook destructuring
(connect, isReady, canConnect). Panel now renders null when no
wallet is connected. Also remove StateCard and ReactNode since
they are no longer needed. Update HeroCard copy to drop the
"Connect a wallet" prompt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: collapse delegation panel into page
Flatten DelegateAccountPanel + DelegateWalletPanel into app/delegate/page.tsx
directly. The component file added indirection with no benefit — one page,
one component, all logic in one place. tokenSymbol is now fetched client-side
via useEffect so the page can be a client component.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove unused canConnect from useGovernanceWallet
canConnect was only used in the old DelegateAccountPanel guard which
is now deleted. Also removes the governanceEnv import which was only
needed for that field.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove dead code — getBrowserProvider, wallet, getGovernorInterface
None of these are consumed outside their definition files.
Inline the provider creation directly into ensureBaseNetwork.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use ethers ZeroAddress instead of local constant
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: move delegation form to /delegates, remove /delegate route
Merges the personal delegation form (wallet balance, voting power,
delegate management) directly into the /delegates page above the
leaderboard. Removes the now-redundant /delegate route.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: self-delegate button and refresh on logout
AddressInput manages its own internal state seeded from value on mount
and does not re-sync when the value prop changes externally. Use a reset
key to force remount when the value is set from outside (self-delegate
button or auto-fill from on-chain delegate).
Also call router.refresh() on logout so the UI clears correctly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove redundant connected wallet address from delegation form
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove Personal Delegation label from delegates page header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ci: fix claude-code-review allowed_tools — use claude_args instead
allowed_tools was removed from claude-code-action@v1; the equivalent
is now claude_args: '--allowedTools ...'. Without this the review agent
cannot post PR comments.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "ci: fix claude-code-review allowed_tools — use claude_args instead"
This reverts commit 4b1451b.
* fix: hide delegation form when not authenticated
Gate on authenticated (from usePrivy) in addition to address.
Privy can return a cached wallet address before the session is
confirmed, causing the form to show while the header still shows
"Connect".
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove hero card from delegates page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: ENS/Basename resolution and per-row Delegate button in leaderboard
- Use <Address useName={...}> from @unlock-protocol/ui for all address
display in leaderboard rows (resolves Basenames then ENS)
- Add per-row Delegate button that pre-fills the delegation form via
?delegate= query param
- Pre-format bigint values server-side before passing to client rows
(bigints can't cross the server→client boundary in Next.js)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: add comments to empty catch blocks to satisfy no-empty lint rule
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent adbd592 commit 5234db4
File tree
16 files changed
+696
-132
lines changed- governance-app
- app
- delegates
- delegate
- public/images
- src
- components
- delegates
- layout
- config
- hooks
- lib/governance
16 files changed
+696
-132
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | | - | |
3 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
7 | 17 | | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
11 | 30 | | |
12 | 31 | | |
| 32 | + | |
| 33 | + | |
13 | 34 | | |
14 | 35 | | |
15 | | - | |
| 36 | + | |
16 | 37 | | |
17 | | - | |
18 | | - | |
| 38 | + | |
| 39 | + | |
19 | 40 | | |
20 | 41 | | |
21 | 42 | | |
22 | | - | |
23 | | - | |
| 43 | + | |
| 44 | + | |
24 | 45 | | |
25 | 46 | | |
26 | 47 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 48 | + | |
| 49 | + | |
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
23 | | - | |
| 20 | + | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments