feat(hero): add image fit prop to prevent SVG cropping#24
feat(hero): add image fit prop to prevent SVG cropping#24rahul-vyas-dev merged 1 commit intoAOSSIE-Org:mainfrom
Conversation
WalkthroughAdded an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 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: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 178: Replace the invalid example value for the typed property fit in the
README snippet (currently fit: "") with a valid union member such as "cover" or
"contain" so the example matches the declared type ("cover" | "contain") and is
safe to copy-paste; update the snippet line for the fit property accordingly
(e.g., set fit to "cover" for full-width images or "contain" for logo-style
images).
In `@src/components/SupportUsButton.tsx`:
- Around line 85-87: The className in SupportUsButton's JSX contains an invalid
Tailwind token "pointer-none:cursor-none"; update the class string in the
relevant JSX (the template literal building className) to use the correct
utilities "pointer-events-none cursor-none" instead, ensuring you keep the
existing conditional for hero.fit and other classes unchanged.
- Line 79: In the SupportUsButton component, remove the invalid Tailwind class
token "pointer-none:cursor-none" from the img elements and, if you intended to
disable pointer interactions, replace it with "pointer-events-none"; do not add
any "cursor-none" replacement since Tailwind has no such utility—update the img
elements in SupportUsButton (look for <img ... className=...> instances) to
remove "cursor-none" and use "pointer-events-none" only when needed.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 60e8b58d-2356-45ba-b716-4a138c541796
📒 Files selected for processing (3)
README.mdsrc/components/SupportUsButton.tsxsrc/types/index.ts
Fix Hero Image Cropping & Add Image Fit Support
Problem
Hero images were using
object-cover, which caused SVGs and logo-style images to be cropped.Changes
fitprop to theHerotype:object-cover(default)object-containwhenfit="contain"fitprop.Result
cover.Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.
Summary by CodeRabbit
Release Notes
New Features
fitoption to hero images: select "cover" for full-width display or "contain" to fit entire images without cropping.Style