-
Notifications
You must be signed in to change notification settings - Fork 3
fix: HTML table text alignment issues #1086
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
WalkthroughThis pull request refactors table header styling across multiple admin, dashboard, and transaction components by replacing inline CSS styles with utility CSS classes. Three new text-alignment utility classes (text-left, text-center, text-right) are added to the global stylesheet, and existing table components are updated to reference these classes instead of inline style attributes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes The changes are highly homogeneous and follow a consistent pattern—straightforward replacement of inline styles with utility classes. All modifications are purely presentational with no logic, control flow, or behavioral changes. The new CSS classes are simple and standard text-alignment utilities. Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ 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.
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 (4)
components/Dashboard/Leaderboard.tsx (1)
38-53: Consider completing the refactoring for consistency.The headers now use CSS utility classes, but the cell content (lines 43-45, 52) still uses inline
style={{textAlign: 'right'}}. For consistency and maintainability, consider replacing these inline styles with thetext-rightclass as well.🔎 Suggested refactor to complete the migration
Cell: (cellProps) => { - return <div style={{ textAlign: 'right', fontWeight: '600' }}> + return <div className="text-right" style={{ fontWeight: '600' }}> {'$'.concat(formatQuoteValue(cellProps.cell.value, currencyId))} </div> }And for the Payments cell:
Cell: (cellProps) => { - return <div style={{ textAlign: 'right', fontWeight: '600' }}>{cellProps.cell.value}</div> + return <div className="text-right" style={{ fontWeight: '600' }}>{cellProps.cell.value}</div> }components/Transaction/PaybuttonTransactions.tsx (1)
88-100: Consider completing the refactoring for consistency.The Amount header now uses the
text-rightclass, but the cell content (line 92) still uses inlinestyle={{textAlign: 'right'}}. For consistency, consider replacing this with the CSS utility class.🔎 Suggested refactor
Cell: (cellProps) => { - return <div style={{ textAlign: 'right', fontWeight: '600' }}>{parseFloat(cellProps.cell.value).toLocaleString( + return <div className="text-right" style={{ fontWeight: '600' }}>{parseFloat(cellProps.cell.value).toLocaleString( undefined,pages/payments/index.tsx (2)
268-280: Consider completing the refactoring for consistency.The Amount header now uses the
text-rightclass, but the cell content (line 279) still uses inlinestyle={{textAlign: 'right'}}. For consistency with the header styling approach, consider using the CSS utility class.🔎 Suggested refactor
- return <div style={{ textAlign: 'right', fontWeight: '600' }}>{formattedAmount}</div> + return <div className="text-right" style={{ fontWeight: '600' }}>{formattedAmount}</div>
283-289: Consider completing the refactoring for consistency.Similar to the Amount column, the Value header uses
text-rightbut the cell (line 288) still uses inline styling. Consider applying the same CSS class approach.🔎 Suggested refactor
- return <div style={{ textAlign: 'right', fontWeight: '600' }}> ${formatQuoteValue(cellProps.cell.value, user.userProfile.preferredCurrencyId)}</div> + return <div className="text-right" style={{ fontWeight: '600' }}> ${formatQuoteValue(cellProps.cell.value, user.userProfile.preferredCurrencyId)}</div>
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
components/Admin/RegisteredUsers.tsx(1 hunks)components/Admin/SubscribedAddresses.tsx(1 hunks)components/Dashboard/Leaderboard.tsx(2 hunks)components/Transaction/PaybuttonTransactions.tsx(3 hunks)pages/payments/index.tsx(6 hunks)styles/global.css(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/Admin/RegisteredUsers.tsx (1)
services/userService.ts (1)
UserWithSupertokens(21-24)
🔇 Additional comments (3)
styles/global.css (1)
197-207: LGTM! Well-structured utility classes.The new text alignment utility classes follow a clear naming convention and will help standardize alignment styles across the application.
components/Admin/SubscribedAddresses.tsx (1)
30-30: LGTM! Consistent with existing cell styling.The View header now uses the
text-centerclass, which aligns well with the existing cell styling that uses thetable-eye-ctnclass (already defined with center alignment in global.css).components/Admin/RegisteredUsers.tsx (1)
34-40: LGTM! Complete and consistent refactoring.Excellent implementation - both the header and cell content use the
text-centerCSS class consistently. This represents the complete refactoring pattern that aligns with the PR objectives.
Description
All html tables across the site should have correct text-align styles on both the headers and data column
Test plan
View all pages, confirming that the text alignment looks good on each html table
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.