Skip to content

Create Wallet Context for global wallet state management#9

Merged
Iwueseiter merged 3 commits intoHubDApp:mainfrom
Luluameh:feat/wallet-context
Feb 25, 2026
Merged

Create Wallet Context for global wallet state management#9
Iwueseiter merged 3 commits intoHubDApp:mainfrom
Luluameh:feat/wallet-context

Conversation

@Luluameh
Copy link
Contributor

@Luluameh Luluameh commented Feb 21, 2026

Closes #4


Wallet Context Implementation
The global wallet state management feature has been successfully implemented to fulfill the requirements of Issue #4.

Implemented state tracking for publicKey, isConnected, and a new isConnecting loading state.
Designed to easily drop in the final Solana/Web3 provider later in Task #3 without changing the consumer signature.
State Persistence (localStorage):

Integrated localStorage to save the isConnected and publicKey values.
Added a useEffect hook that restores this state when the components mount.
This ensures the wallet remains visually disconnected/connected across page reloads seamlessly.
UX Enhancements (
page.tsx
):

Updated the main interface to consume the new isConnecting state.
Added a visually pleasing loading spinner and a "Connecting..." label when the user initiates a wallet connection.
Handled edge cases during hydration and button disabling states while connecting, delivering a highly professional Web3 feel.
Validation Results
The
WalletProvider
successfully wraps the main application tree via
layout.tsx
.
Connect/disconnect actions mock an 800ms delay to reflect realistic network latency.
Component state persists safely across browser sessions without causing hydration mismatch errors.
Visual feedback is responsive to user interactions as expected.

Screen.Recording.2026-02-22.002246.mp4

@Luluameh
Copy link
Contributor Author

Hello @Iwueseiter, please review my PR

@Iwueseiter
Copy link
Contributor

Hello @Luluameh, this task depends on #3, which has just been implemented. Please pull and ensure your implementation is functioning as expected.

@Luluameh
Copy link
Contributor Author

Hello @Iwueseiter Done with it, waiting for review.

@Iwueseiter Iwueseiter merged commit ef1e502 into HubDApp:main Feb 25, 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.

Create Wallet Context for global wallet state management

2 participants