Skip to content

feat(ui): add wallet connect button to header and expose wallet state#75

Merged
mikewheeleer merged 2 commits into
Talenttrust:mainfrom
kitWarse:feature/wallet-connect-header
Jun 2, 2026
Merged

feat(ui): add wallet connect button to header and expose wallet state#75
mikewheeleer merged 2 commits into
Talenttrust:mainfrom
kitWarse:feature/wallet-connect-header

Conversation

@kitWarse
Copy link
Copy Markdown

@kitWarse kitWarse commented Jun 2, 2026

Overview

This PR introduces a global wallet connection affordance to the TalentTrust frontend:

  • WalletProvider – React context that manages wallet connection state (address, isConnecting, error) and provides connect/disconnect actions.
  • WalletConnectButton – Header component that:
    • Shows a “Connect Wallet” button while disconnected.
    • Displays the truncated wallet address (via src/lib/truncateAddress.ts) with a copy‑to‑clipboard button once connected.
    • Provides a “Disconnect” button and visual feedback for loading, success, and error states.
    • Is fully keyboard‑operable and meets WCAG 2.1 AA accessibility requirements.
  • Header Integration – Updated src/app/layout.tsx to wrap the app in WalletProvider and render WalletConnectButton in a sticky header.
  • ActionPanel Guarding – All action buttons (Submit Milestone, Release Funds, Dispute) now disable when the wallet is not connected, with an inline hint prompting the user to connect.
  • Testing & Docs
    • Added unit tests for WalletConnectButton covering connection states, copy functionality, and error handling.
    • Updated jest.setup.js with a global mock for WalletContext, ensuring existing tests continue to pass.
    • Added documentation docs/components/WalletConnectButton.md detailing usage, props, and accessibility notes.
    • Adjusted tests for ActionPanel to use the new wallet context mock.

Why

TalentTrust escrow actions (milestones, payouts, disputes) require a connected wallet, but the existing UI lacked a global wallet UI. This change provides a clear, accessible entry point for users to connect/disconnect their wallet and ensures that contract‑related actions respect the connection state.

Screenshots

(Add screenshots of the header with “Connect Wallet” and the connected state, and the disabled ActionPanel buttons.)

Checklist

  • Header displays wallet button with connection handling.
  • Wallet state is exposed via useWallet hook.
  • ActionPanel respects wallet connection.
  • All unit tests pass (npm test → 68 passing).
  • Documentation added.
  • Linting passes (npm run lint).
  • PR targets feature/wallet-connect-header branch.

Related Issue

Closes #45 – “Add Connect Wallet control to the app header.”

Additional Notes

  • The component uses inline SVGs for icons to avoid adding a new heavy dependency (lucide-react).
  • The context is deliberately lightweight; integration with actual wallet SDKs can be added later without breaking the UI.

- Added WalletContext to manage wallet connection state
- Created WalletConnectButton component with connect, disconnect, and copy functionality
- Integrated WalletConnectButton into layout.tsx header
- Updated ActionPanel to gate milestone, dispute, and release funds actions based on wallet state
- Added tests for WalletConnectButton covering connected, disconnected, and error states
- Added documentation for WalletConnectButton

Closes Talenttrust#45
- Replaced missing AlertCircle icon with an inline SVG in WalletConnectButton
- Added a global mock for WalletContext in jest.setup.js to resolve 'useWallet must be used within a WalletProvider' errors in existing test suites
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@kitWarse Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mikewheeleer mikewheeleer merged commit 44d29a0 into Talenttrust:main Jun 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add wallet connect button and connection state to layout header

3 participants