Skip to content

feat(ui-loader): loader for sendButton transactions #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dhananjaypai08
Copy link

@dhananjaypai08 dhananjaypai08 commented Jun 13, 2025

Summary

This PR introduces a reusable Loader component and integrates it into the SendButton workflow to enhance UX feedback during async operations. The spinner replaces button text during loading states like approvals and transfers, giving users a clear visual cue that a process is underway.

Note : This can be further used for connectWallet and other components


Changes Introduced

  • Created a lightweight, reusable Loader component (Loader.tsx) using Tailwind for consistent styling within the packages/ccip-react-components/lib

  • Integrated Loader in the SendButton:

    • During token approval (Approve)
    • During LINK/fee token approval (Approve LINK)
    • During token transfer (Send)
  • Replaced button text dynamically with the spinner during each respective async mutation’s pending state (isPending).


Why This Change?

  • Improves user feedback and perception of responsiveness during blockchain interactions.
  • Reduces the risk of duplicate submissions by visibly indicating loading states.
  • Keeps UX consistent and clean with reusable visual feedback across components.

@dhananjaypai08 dhananjaypai08 requested a review from a team as a code owner June 13, 2025 20:50
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.

1 participant