feat: add isLoading prop to Button component with spinner#320
feat: add isLoading prop to Button component with spinner#320palak170306-design wants to merge 2 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @palak170306-design!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe Button component now accepts an ChangesButton Loading State
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/ui/button.tsx`:
- Around line 57-61: The disabled prop is currently being overridden because
{...props} is spread after disabled={isLoading || props.disabled}; fix by
computing a final disabled value (e.g., const finalDisabled = isLoading ||
props.disabled) or by spreading {...props} before other explicit props and then
setting disabled={finalDisabled} so isLoading always forces disabled; update the
JSX in the Comp element (the usage of Comp, isLoading, props, and disabled) to
ensure the explicit disabled value wins over any disabled passed in props.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ef94108-8cff-4fc4-a248-e142b4428f4b
📒 Files selected for processing (1)
components/ui/button.tsx
Summary
isLoading?: booleanprop to the base<Button>component in
components/ui/button.tsxisLoading={true}, aLoader2spinning icon fromlucide-react renders next to the button text
isLoading={true}to preventdouble clicks during async operations
disabledprop withno visual feedback — this improves UX significantly
Type of change
Related issue
Closes #302
Validation
npm run lintnpm testnpm run buildList any additional manual verification you performed:
isLoading={true}renders spinning Loader2 iconisLoading={true}disabledprop still work unchangedScreenshots or recordings
N/A — component-level change, no UI screenshots applicable
Checklist
Summary by CodeRabbit