Skip to content
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

fix: centered cards on case studies page maintaing responsiveness. #3791

Closed
wants to merge 3 commits into from

Conversation

shaileshkaliya
Copy link

@shaileshkaliya shaileshkaliya commented Mar 4, 2025

Description

Walkthrough

This pull request fixes the alignment issue on the case studies page (Issue #3788), ensuring that the cards are properly centered. The updated layout is designed to handle future additions of new cards without breaking responsiveness.

Changes

File(s) Change Summary
CaseStudyCard.tsx Updated Tailwind CSS classes to properly center the cards while maintaining a flexible responsive layout.

Before & After Screenshots

Before fix :
image

After fix :

Screenshot 2025-03-05 002937

In mobile size screens :

image

This fix ensures better visual balance and scalability. Let me know if any refinements are needed! 🚀

Related issue(s)
Fixes issue #3788

Summary by CodeRabbit

  • Style
    • Adjusted the layout of case study cards for larger screens by switching from a grid-based to a flexbox approach with improved center alignment.

Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Walkthrough

This change updates the layout strategy in the CaseStudyCard component. The modification involves replacing the grid layout classes (lg:grid and lg:grid-cols-3) with flexbox classes (lg:flex and lg:justify-center). Additionally, a justify-center class has been added to the base class list for improved alignment on larger screens. There are no changes to exported interfaces or public entities.

Changes

File Change Summary
components/CaseStudyCard.tsx Replaced lg:grid and lg:grid-cols-3 with lg:flex and lg:justify-center; added justify-center to the base class list for centering content.

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • magicmatatjahu
  • devilkiller-ag
  • akshatnema
  • sambhavgupta0705
  • asyncapi-bot-eve
  • Mayaleeeee

Poem

I'm a rabbit, hopping with cheer,
Flex over grid, the shift is clear.
Cards centered with a graceful glide,
In code and layout, we take a joyful ride.
With a hop and a skip, our changes shine bright,
Celebrating new alignment in pure delight!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d70ffee and e44c214.

📒 Files selected for processing (1)
  • components/CaseStudyCard.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/CaseStudyCard.tsx
⏰ Context from checks skipped due to timeout of 180000ms (3)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Copy link

netlify bot commented Mar 4, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e44c214
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67c899648a2a330008d566b4
😎 Deploy Preview https://deploy-preview-3791--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shaileshkaliya shaileshkaliya changed the title fix: Centered cards on case studies page maintaing responsiveness. fix: centered cards on case studies page maintaing responsiveness. Mar 4, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
components/CaseStudyCard.tsx (1)

22-22: Fix quotes and optimize redundant Tailwind classes.

I see you've successfully changed from a grid to a flexbox layout for better centering of the cards. However, there are a few optimization opportunities:

  1. There are redundant Tailwind classes: lg:flex and lg:justify-center are unnecessary since you already have flex and justify-center in the base classes.
  2. The static analysis flagged an issue with using double quotes instead of single quotes for the className attribute.
-    <div className="flex flex-wrap gap-3 justify-center pt-10 lg:flex lg:justify-center lg:gap-8 lg:text-center">
+    <div className='flex flex-wrap gap-3 justify-center pt-10 lg:gap-8 lg:text-center'>

This change removes the redundant classes while maintaining the same functionality and fixes the quotes to match the project's style conventions.

🧰 Tools
🪛 ESLint

[error] 22-22: Replace "flex·flex-wrap·gap-3·justify-center·pt-10·lg:flex·lg:justify-center·lg:gap-8·lg:text-center" with 'flex·flex-wrap·gap-3·justify-center·pt-10·lg:flex·lg:justify-center·lg:gap-8·lg:text-center'

(prettier/prettier)


[error] 22-22: Unexpected usage of doublequote.

(jsx-quotes)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9687130 and d70ffee.

📒 Files selected for processing (1)
  • components/CaseStudyCard.tsx (1 hunks)
🧰 Additional context used
🪛 ESLint
components/CaseStudyCard.tsx

[error] 22-22: Replace "flex·flex-wrap·gap-3·justify-center·pt-10·lg:flex·lg:justify-center·lg:gap-8·lg:text-center" with 'flex·flex-wrap·gap-3·justify-center·pt-10·lg:flex·lg:justify-center·lg:gap-8·lg:text-center'

(prettier/prettier)


[error] 22-22: Unexpected usage of doublequote.

(jsx-quotes)

⏰ Context from checks skipped due to timeout of 180000ms (1)
  • GitHub Check: Lighthouse CI
🔇 Additional comments (1)
components/CaseStudyCard.tsx (1)

22-38: Great implementation of responsive centering.

The change from grid to flexbox for the case study cards layout is an effective solution to the centering issue mentioned in the PR objectives. Using flex, flex-wrap, and justify-center ensures that:

  1. Cards are properly centered on all screen sizes
  2. The layout remains responsive
  3. New cards can be added without breaking the design

The increased gap (lg:gap-8) on larger screens also improves readability and visual separation between cards.

🧰 Tools
🪛 ESLint

[error] 22-22: Replace "flex·flex-wrap·gap-3·justify-center·pt-10·lg:flex·lg:justify-center·lg:gap-8·lg:text-center" with 'flex·flex-wrap·gap-3·justify-center·pt-10·lg:flex·lg:justify-center·lg:gap-8·lg:text-center'

(prettier/prettier)


[error] 22-22: Unexpected usage of doublequote.

(jsx-quotes)

@devilkiller-ag
Copy link
Member

devilkiller-ag commented Mar 5, 2025

Hi @shaileshkaliya, Can you check and resolve the failing tests.

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (85910c8) to head (e44c214).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3791   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          667       667           
  Branches       113       113           
=========================================
  Hits           667       667           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shaileshkaliya
Copy link
Author

@devilkiller-ag
I had updated my code as per failing test, ig the Lighthouse CI failure is not related to mine code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants