-
-
Notifications
You must be signed in to change notification settings - Fork 5
Support RTL in ResponsiveGrid #51
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
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request introduces a new Changes
Assessment against linked issues
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
🧹 Outside diff range and nitpick comments (3)
src/responsive-grid/types.ts (1)
71-72
: Add JSDoc documentation for the direction propThe type definition is correct, but adding documentation would improve developer experience and make the RTL support more discoverable.
+ /** + * Controls the layout direction of the grid. + * - 'ltr': Items are laid out from left to right (default) + * - 'rtl': Items are laid out from right to left + * @default 'ltr' + */ direction?: 'rtl' | 'ltr';src/responsive-grid/index.tsx (2)
163-163
: Consider renaming item.left for better semanticsThe property name
item.left
might be confusing when used in RTL mode. Consider renaming it toitem.offset
or similar to better represent its purpose in both LTR and RTL contexts.This would require changes in the
calcResponsiveGrid
function as well. Would you like me to help with this refactor?
29-31
: Consider additional RTL experience improvementsWhile the basic RTL layout is implemented, consider enhancing the RTL support with:
- RTL-aware scroll behavior
- RTL-aware gesture handling
- RTL-aware animations
This would provide a more complete RTL experience for users.
Would you like guidance on implementing any of these enhancements?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/responsive-grid/index.tsx
(2 hunks)src/responsive-grid/types.ts
(1 hunks)
🔇 Additional comments (2)
src/responsive-grid/index.tsx (2)
29-31
: LGTM! Clean implementation of direction support
The direction prop with default 'ltr' and the dynamic start position computation is well implemented.
31-31
: Verify RTL implementation with various scenarios
Let's verify the RTL implementation works correctly in different scenarios.
Also applies to: 163-163
Hello @forabi |
@forabi |
Fixes #50
Summary by CodeRabbit
New Features
direction
prop for theResponsiveGrid
component, allowing users to specify layout direction (left-to-right or right-to-left).Documentation
direction
prop and refined descriptions for clarity across grid components.