-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
[CHORES] Refactor CSS for Org Post #2774
[CHORES] Refactor CSS for Org Post #2774
Conversation
Warning Rate limit exceeded@hustlernik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 56 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)
WalkthroughThis pull request focuses on refactoring the CSS for the Organization Post screen by removing the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
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: 1
🧹 Nitpick comments (5)
src/style/app.module.css (5)
1598-1626
: Consider using CSS custom properties for repeated values.The container styles are well-structured, but we can improve maintainability by extracting common values into CSS custom properties.
+:root { + --orgpost-margin: 2.5rem 0; + --orgpost-button-width: 52px; + --orgpost-outline-color: var(--bs-gray-400); +} .btnsContainerOrgPost { display: flex; - margin: 2.5rem 0 2.5rem 0; + margin: var(--orgpost-margin); } .btnsContainerOrgPost input { - outline: 1px solid var(--bs-gray-400); + outline: 1px solid var(--orgpost-outline-color); } .btnsContainerOrgPost .inputOrgPost button { - width: 52px; + width: var(--orgpost-button-width); }
1627-1648
: Enhance preview component responsiveness.The preview component uses a fixed width which might not work well on smaller screens. Consider making it more responsive.
.previewOrgPost img, .previewOrgPost video { - width: 400px; + width: 100%; + max-width: 400px; height: auto; }
1702-1716
: Improve button styles maintainability.The button styles use hardcoded values and could be simplified.
+:root { + --orgpost-btn-border-color: #e8e5e5; + --orgpost-btn-shadow: 0 2px 2px var(--orgpost-btn-border-color); + --orgpost-btn-transition: 0.2s ease; +} .addbtnOrgPost { - border: 1px solid #e8e5e5; - box-shadow: 0 2px 2px #e8e5e5; + border: 1px solid var(--orgpost-btn-border-color); + box-shadow: var(--orgpost-btn-shadow); border-radius: 5px; font-size: 16px; height: 60%; width: 60%; color: white; outline: none; font-weight: 600; cursor: pointer; - transition: - transform 0.2s, - box-shadow 0.2s; + transition: all var(--orgpost-btn-transition); }
1741-1782
: Optimize loader animation.The loader animation has duplicate keyframe definitions and unnecessary vendor prefixes for modern browsers.
.loader { margin: 60px auto; margin-top: 35vh !important; font-size: 10px; position: relative; text-indent: -9999em; border-top: 1.1em solid rgba(255, 255, 255, 0.2); border-right: 1.1em solid rgba(255, 255, 255, 0.2); border-bottom: 1.1em solid rgba(255, 255, 255, 0.2); border-left: 1.1em solid #febc59; - -webkit-transform: translateZ(0); - -ms-transform: translateZ(0); transform: translateZ(0); - -webkit-animation: load8 1.1s infinite linear; animation: load8 1.1s infinite linear; } -@-webkit-keyframes load8 { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} @keyframes load8 { 0% { - -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { - -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
1783-1793
: Consider using CSS clamp for flexible sizing.The list box uses a fixed viewport height which might not be ideal for all screen sizes.
.list_box { - height: 70vh; + height: clamp(300px, 70vh, 800px); overflow-y: auto; width: auto; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/screens/OrgPost/OrgPost.module.css
(0 hunks)src/screens/OrgPost/OrgPost.tsx
(6 hunks)src/style/app.module.css
(1 hunks)
💤 Files with no reviewable changes (1)
- src/screens/OrgPost/OrgPost.module.css
✅ Files skipped from review due to trivial changes (1)
- src/screens/OrgPost/OrgPost.tsx
🔇 Additional comments (1)
src/style/app.module.css (1)
1650-1701
: Well-structured responsive design implementation.
The media queries follow best practices with appropriate breakpoints and mobile-first approach.
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 (5)
src/style/app.module.css (5)
1598-1626
: Consider using CSS custom properties for consistent values.The button and container styles are well-structured, but could be improved by:
- Extracting repeated values like margins and outlines into CSS custom properties
- Using more semantic class names for better maintainability
+:root { + --orgpost-container-margin: 2.5rem 0; + --orgpost-outline-color: var(--bs-gray-400); + --orgpost-button-width: 52px; +} .btnsContainerOrgPost { display: flex; - margin: 2.5rem 0 2.5rem 0; + margin: var(--orgpost-container-margin); } .btnsContainerOrgPost input { - outline: 1px solid var(--bs-gray-400); + outline: 1px solid var(--orgpost-outline-color); } .btnsContainerOrgPost .inputOrgPost button { - width: 52px; + width: var(--orgpost-button-width); }
1627-1641
: Enhance responsive behavior for media preview.The media preview styles could be more responsive:
- Consider using max-width instead of fixed width
- Add aspect-ratio property for better media scaling
.previewOrgPost img { - width: 400px; + max-width: 400px; + width: 100%; height: auto; + aspect-ratio: auto; } .previewOrgPost video { - width: 400px; + max-width: 400px; + width: 100%; height: auto; + aspect-ratio: 16/9; }
1642-1701
: Optimize media queries and margin consistency.The responsive styles are well-implemented but could be optimized:
- Consider consolidating media queries for similar breakpoints
- Use consistent margin declarations
@media (max-width: 1020px) { .btnsContainerOrgPost { flex-direction: column; - margin: 1.5rem 0; + margin: var(--orgpost-container-margin); } } -@media (max-width: 520px) { +@media (max-width: 575.5px) { .btnsContainerOrgPost { margin-bottom: 0; } + .mainpagerightOrgPost { + width: 98%; + } } -@media screen and (max-width: 575.5px) { - .mainpagerightOrgPost { - width: 98%; - } -}
1702-1736
: Optimize button styles and transitions.The button styles are well-structured but could be improved:
- Extract common button properties to custom properties
- Make transitions more specific to improve performance
+:root { + --orgpost-button-shadow: 0 2px 2px #e8e5e5; + --orgpost-button-transition: 0.2s ease; +} .addbtnOrgPost { border: 1px solid #e8e5e5; - box-shadow: 0 2px 2px #e8e5e5; + box-shadow: var(--orgpost-button-shadow); transition: - transform 0.2s, - box-shadow 0.2s; + transform var(--orgpost-button-transition), + box-shadow var(--orgpost-button-transition); }
1778-1788
: Enhance list box styles with custom properties.The list box styles could be improved:
- Use custom properties for viewport-based values
- Consider consolidating with other mobile media queries
+:root { + --list-box-height: 70vh; + --form-wrapper-mobile-width: 90%; +} .list_box { - height: 70vh; + height: var(--list-box-height); overflow-y: auto; width: auto; } @media only screen and (max-width: 600px) { .form_wrapper { - width: 90%; + width: var(--form-wrapper-mobile-width); top: 45%; } }
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2774 +/- ##
=====================================================
+ Coverage 71.94% 87.17% +15.22%
=====================================================
Files 296 313 +17
Lines 7358 8204 +846
Branches 1606 1792 +186
=====================================================
+ Hits 5294 7152 +1858
+ Misses 1804 867 -937
+ Partials 260 185 -75 ☔ View full report in Codecov by Sentry. |
7755890
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Streamlined all CSS for OrgPost into a single global file, fixed UI bugs on the OrgPost page, and ensured no conflicts with other pages.
Issue Number:
Fixes #2522
Did you add tests for your changes?
No
Does this PR introduce a breaking change?
No
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Style