Skip to content

Connect Wallet: Loading State Spinner in Button #610

Description

@SheyeJDev

Problem: When connect() is called from onConnectWallet() in split-app.tsx, the wallet state reducer dispatches { type: "LOADING" } which sets loading: true in the context — but the "Connect Wallet" button never reads loading from the wallet context and shows no spinner or disabled state during the async call. The button remains fully clickable while the Freighter modal is opening, allowing double-clicks.

Scope: Disable the "Connect Wallet" button and show a spinner while wallet.loading is true.

Implementation guidance:
In the wallet button rendering in split-app.tsx (or WalletButton.tsx from FE-006), read loading from useWallet().
Apply disabled={loading} and replace the button label with a spinner SVG when loading.
Also disable the "Switch Wallet" and "Sync" buttons during loading.

Acceptance criteria: The button cannot be double-clicked; a spinner is visible while the wallet modal is loading; the button re-enables after success or failure.

Validation: Unit test that the button is disabled when loading = true.

Files to modify: frontend/src/components/split-app.tsx

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfrontendNext.js UI (React/TS) work

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions