Fix: Improve Button accessibility and prop forwarding#58
Conversation
📝 WalkthroughWalkthroughThe Button component is converted from a default export to a named export with a new ButtonProps alias, destructured props (defaulting type="button"), and prop forwarding; several sections updated imports and simplified surrounding markup to use the new named Button export. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
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
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
🤖 Fix all issues with AI agents
In `@src/components/Button.tsx`:
- Around line 3-7: The project changed Button to a named export (export const
Button), but three consumers still use the default import; update imports in
src/sections/Hero.tsx, src/sections/Header.tsx, and
src/sections/CallToAction.tsx to import the named symbol Button (replace "import
Button from '@/components/Button'" with "import { Button } from
'@/components/Button'") so they reference the exported Button identifier used in
the component file.
What
Why
type="button"and did not accept props likeonClick,disabled, etc., which affected accessibility and reusability.How
type="button"and forwardedButtonHTMLAttributesto the underlying<button>element.Testing
Fixes #43
Summary by CodeRabbit
Refactor
Style
✏️ Tip: You can customize this high-level summary in your review settings.