-
Notifications
You must be signed in to change notification settings - Fork 110
fix: add lightbox otherProps #958
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe changes introduce an optional Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/components/src/lightbox/interface.ts (1)
39-39: Consider a more specific type for better type safety.Using
anybypasses TypeScript's type checking. Consider using a more specific type likeRecord<string, unknown>or defining an interface for the expected shape ofotherProps.Apply this diff for improved type safety:
- otherProps?: any; + otherProps?: Record<string, unknown>;packages/components/src/lightbox/react-image-lightbox.tsx (1)
1538-1683: Consider adding PropTypes definition for consistency.The
otherPropsprop is not included in the PropTypes definition. While PropTypes are optional and this doesn't affect functionality, adding it would maintain consistency with the rest of the component's prop documentation.Add this entry to the PropTypes definition:
// custom loader loader: PropTypes.node, + + // Additional props to pass to the image renderer component + otherProps: PropTypes.object, };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/components/src/lightbox/interface.ts(1 hunks)packages/components/src/lightbox/react-image-lightbox.tsx(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: test-coverage
- GitHub Check: tests
🔇 Additional comments (2)
packages/components/src/lightbox/react-image-lightbox.tsx (2)
1273-1273: LGTM!The destructuring of
otherPropsfrom props is clean and follows the established pattern in this component.
1330-1341: Excellent prop spreading pattern.The implementation correctly spreads
otherPropsfirst, then applies explicit props. This ensures that internal component props (likeonDoubleClick,onWheel) take precedence over any conflicting props inotherProps, maintaining component integrity while allowing flexibility.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.