-
-
Notifications
You must be signed in to change notification settings - Fork 811
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
Refactoring CSS files: merged FundCompaignPledge styles into global app.module.css #2706
Refactoring CSS files: merged FundCompaignPledge styles into global app.module.css #2706
Conversation
Warning Rate limit exceeded@mandeepnh5 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 41 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request focuses on refactoring the CSS files in the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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: 3
🧹 Nitpick comments (1)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx (1)
476-483
: Consider accessibility improvements for search inputWhile the styling changes look good, consider adding ARIA labels for better accessibility.
Apply this enhancement:
<Form.Control type="name" placeholder={t('searchPledger')} autoComplete="off" required className={styles.inputFieldPledge} value={searchTerm} onChange={(e) => setSearchTerm(e.target.value)} data-testid="searchPledger" + aria-label={t('searchPledger')} />
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx
(14 hunks)
🧰 Additional context used
🪛 GitHub Check: Performs linting, formatting, type-checking, checking for different source and target branch
src/screens/FundCampaignPledge/FundCampaignPledge.tsx
[failure] 210-210:
Property 'messagePledge' does not exist on type 'Error'.
🔇 Additional comments (2)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx (2)
12-12
: LGTM: Style import path updated correctly
The import statement has been updated to use the global styles from app.module.css, which aligns with the PR objective of consolidating styles.
502-502
: LGTM: Consistent styling for table elements
The styling changes for dropdown, table rows, and images are consistent with the PR's objective of consolidating styles into the global CSS file.
Also applies to: 563-563, 613-613, 620-620
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.
Please fix the failing tests. Our test code coverage system will fail if any of these conditions occur:
- The overall code coverage drops below the target threshold of the repository
- Any file in the pull request has code coverage levels below the repository threshold
- The code does not comply with our linting check or other related formatting requirements
Here are some steps to take:
- Click on the
Details
link for the tests to get an explanation of the cause(s) - You may have to fix a test that is not related to this PR as in some rare cases we merge faulty test code. If this is the case, fix the test in this PR. Do not open another issue.
We do this to ensure the overall reliability of the code base is maintained. This is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.
Additional notes:
- Ensure that CodeRabbit.ai approves your work
- Please fix any conflicting files
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: 2
🧹 Nitpick comments (3)
src/style/app.module.css (3)
688-700
: Consolidate input styles and use CSS variablesThe input and dropdown styles could be improved by:
- Using CSS variables for colors
- Consolidating with existing similar classes like
.inputField
and.dropdown
.inputFieldPledge { background-color: white; - box-shadow: 0 1px 1px #31bb6b; + box-shadow: 0 1px 1px var(--bs-primary); } .dropdownPledge { background-color: white; - border: 1px solid #31bb6b; + border: 1px solid var(--bs-primary); position: relative; display: inline-block; - color: #31bb6b; + color: var(--bs-primary); }
730-741
: Use CSS variables for consistent stylingThe
.pledgerContainer
uses hardcoded colors and dimensions. Consider using CSS variables for better maintainability..pledgerContainer { display: flex; align-items: center; justify-content: center; margin: 0.1rem 0.25rem; gap: 0.25rem; padding: 0.25rem 0.45rem; border-radius: 0.35rem; - background-color: #31bb6b33; + background-color: var(--bs-primary-light); height: 2.2rem; margin-top: 0.75rem; }
747-758
: Consider using semantic class namesThe
.overviewContainer
class could be made more reusable by using semantic class names that describe the component's purpose rather than its specific implementation.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx
(14 hunks)src/style/app.module.css
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/screens/FundCampaignPledge/FundCampaignPledge.tsx
🔇 Additional comments (3)
src/style/app.module.css (3)
611-623
: LGTM: Container styles are clean and follow existing patterns
The container styles are well-structured and maintain consistency with the existing layout patterns.
701-717
: LGTM: Table styles follow best practices
The table styles make good use of CSS variables and maintain consistency with existing patterns.
870-876
:
Fix incorrect attribute selector
The attribute selector for radio buttons is incorrect. It should be type='radio'
instead of type='radioPledge'
.
- input[type='radioPledge']:checked + label {
+ input[type='radio']:checked + label {
background-color: #31bb6a50 !important;
}
- input[type='radioPledge']:checked + label:hover {
+ input[type='radio']:checked + label:hover {
color: black !important;
}
Likely invalid or redundant comment.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 1
🔭 Outside diff range comments (2)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx (2)
Line range hint
428-450
: Fix radio button implementation inconsistencies.There are two issues in the radio button implementation:
- Inconsistent use of btn-check class
- Missing type attribute value
Apply this diff to fix the issues:
-className={`btn-check ${styles.toggleBtnPledge}`} +className="btn-check" -type="radio" +className="btn-check"
Line range hint
474-493
: Improve search input accessibility.The search implementation needs accessibility improvements:
- Add aria-label to the search button
- Add aria-hidden to the search icon
Apply these changes:
<Button tabIndex={-1} className={`position-absolute z-10 bottom-0 end-0 d-flex justify-content-center align-items-center`} data-testid="searchBtn" + aria-label="Search pledgers" > - <Search /> + <Search aria-hidden="true" /> </Button>
🧹 Nitpick comments (1)
src/style/app.module.css (1)
713-784
: Add responsive design for better mobile experience.The overview and progress tracking components need responsive design improvements for better mobile display.
Add these media queries:
.overviewContainer { display: flex; gap: 7rem; width: 100%; /* ... */ } + +@media (max-width: 768px) { + .overviewContainer { + flex-direction: column; + gap: 2rem; + padding: 1rem; + } + + .progressContainer { + width: 100%; + } +}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx
(7 hunks)src/screens/FundCampaignPledge/PledgeModal.tsx
(6 hunks)src/style/app.module.css
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/screens/FundCampaignPledge/PledgeModal.tsx
🔇 Additional comments (3)
src/screens/FundCampaignPledge/FundCampaignPledge.tsx (2)
12-12
: LGTM! Style consolidation aligns with PR objectives.
The import statement has been updated to use the global app.module.css file, which aligns with the PR's goal of consolidating styles.
Line range hint 560-572
: LGTM! DataGrid implementation is well structured.
The DataGrid implementation correctly uses:
- Custom row styling
- Proper data mapping
- Appropriate height settings
src/style/app.module.css (1)
818-834
: 🛠️ Refactor suggestion
Improve toggle button accessibility and consistency.
The toggle button styles need improvements:
- Use CSS variables for colors
- Add focus styles for keyboard navigation
Apply these changes:
.toggleBtnPledge:hover {
- color: #31bb6b !important;
+ color: var(--bs-primary) !important;
+}
+
+.toggleBtnPledge:focus-visible {
+ outline: 2px solid var(--bs-primary);
+ outline-offset: 2px;
}
Likely invalid or redundant comment.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 1
🧹 Nitpick comments (4)
src/style/app.module.css (4)
611-623
: Use CSS variables for consistent modal dimensionsConsider using the existing modal dimension variables for consistency:
.pledgeModal { - max-width: 80vw; + max-width: var(--modal-max-width); margin-top: 2vh; margin-left: 13vw; }
688-722
: Use CSS variables for colors and shadowsThe styles use hardcoded RGBA colors and box shadow values instead of CSS variables.
.overviewContainer { - background-color: rgba(255, 255, 255, 0.591); + background-color: var(--bs-white-rgb, 255, 255, 255, 0.591); - box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; + box-shadow: var(--bs-box-shadow); border-radius: 0.5rem; }
724-782
: Improve color consistency and style reusabilityThe title and progress styles use hardcoded colors that should be defined as CSS variables.
.titleContainer h3 { font-size: 1.75rem; font-weight: 750; - color: #5e5e5e; + color: var(--bs-gray-700); margin-top: 0.2rem; } .titleContainer span { font-size: 0.9rem; margin-left: 0.5rem; font-weight: lighter; - color: #707070; + color: var(--bs-gray-600); }
784-833
: Standardize UI component colorsThe toggle button and popup styles use hardcoded colors instead of CSS variables.
.toggleBtnPledge:hover { - color: #31bb6b !important; + color: var(--bs-primary) !important; } .popup { border-radius: 0.5rem; font-size: 0.875rem; margin-top: 0.5rem; padding: 0.75rem; - border: 1px solid #e2e8f0; + border: 1px solid var(--bs-gray-300); background-color: white; - color: #1e293b; + color: var(--bs-gray-900); - box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.15); + box-shadow: var(--bs-box-shadow-lg); }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/style/app.module.css
(1 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)
625-667
: 🛠️ Refactor suggestion
Consolidate duplicate button styles and use CSS variables
The .greenregbtnPledge
class is nearly identical to the existing .greenregbtn
class. Also, some styles use hardcoded colors instead of CSS variables.
.inputFieldPledge {
background-color: white;
- box-shadow: 0 1px 1px #31bb6b;
+ box-shadow: 0 1px 1px var(--bs-primary);
}
-/* Remove .greenregbtnPledge and use existing .greenregbtn class */
-.greenregbtnPledge {
- margin-top: 15px;
- border: 1px solid var(--bs-gray-300);
- /* ... rest of the properties ... */
-}
Likely invalid or redundant comment.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2706 +/- ##
=====================================================
+ Coverage 75.84% 87.08% +11.24%
=====================================================
Files 295 312 +17
Lines 7289 8148 +859
Branches 1593 1840 +247
=====================================================
+ Hits 5528 7096 +1568
+ Misses 1497 875 -622
+ Partials 264 177 -87 ☔ View full report in Codecov by Sentry. |
@palisadoes I have fixed everything now please check |
86d59c2
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Refactoring CSS files: merged FundCompaignPledge styles into global app.module.css
Issue Number:
Fixes #2507
Did you add tests for your changes?
No
Summary
It is my second PR on Palisadoes Foundation and I am looking forward to contribute more to this organization.
This PR solves the problem of having a single global CSS file instead of having many CSS files in sub directories.
Does this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores