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: #3544 Misalignment of Height and Spacing in Case Study Block on Desktop and Mobile Views. #3561

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

Sonalilipsa17375
Copy link
Contributor

@Sonalilipsa17375 Sonalilipsa17375 commented Jan 10, 2025

Description

  • fix : Bug fix
  • description : This PR resolves the issue of misaligned height and spacing in case study block on desktop and mobile views.
  • Test Results - Reference images attached :

Mobile View -

Screenshot From 2025-01-10 20-52-43

Desktop View -

Screenshot From 2025-01-10 20-53-12

fixes #3544

Summary by CodeRabbit

  • Style
    • Improved case study card layout with consistent horizontal spacing.
    • Ensured uniform card height across case study grid with a minimum height of 300 pixels.
    • Enhanced visual presentation of case study section.

Copy link

coderabbitai bot commented Jan 10, 2025

Walkthrough

The pull request modifies the CaseStudyCard component to enhance its layout and visual consistency. The changes involve adjusting the JSX structure and styling by adding the gap-3 class for horizontal spacing between grid items. Additionally, the inner div now includes h-full and min-h-[300px], ensuring that each card maintains a minimum height of 300 pixels and occupies the full height of its parent container.

Changes

File Change Summary
components/CaseStudyCard.tsx - Added gap-3 class for horizontal spacing between grid items
- Updated inner div classes to include h-full and min-h-[300px] for consistent card heights

Poem

🐰 Hop, hop, through the code we go,
Case study cards now neatly in a row
Spacing just right, heights align with glee
A pixel-perfect grid for all to see!
Rabbit's design magic, clean and bright 🌟


📜 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 d779a39 and ee88cd3.

📒 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

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?

❤️ 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. (Beta)
  • @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

netlify bot commented Jan 10, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ee88cd3
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67814e5c549d50000748b1f9
😎 Deploy Preview https://deploy-preview-3561--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.

Copy link

@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 (3)
components/CaseStudyCard.tsx (3)

22-22: Reorder Tailwind classes for better maintainability.

The class ordering should follow Tailwind's recommended pattern: layout → spacing → responsive variants.

-    <div className='flex flex-wrap pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center gap-y-3'>
+    <div className='flex flex-wrap gap-y-3 pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center'>
🧰 Tools
🪛 GitHub Actions: PR testing - if Node project

[warning] 22-22: Invalid Tailwind CSS classnames order


26-26: Fix formatting issues and reorder Tailwind classes.

The line contains trailing whitespace and needs class reordering.

-            className='max-w-sm h-full overflow-hidden min-h-[300px] rounded-md border border-gray-200 bg-white p-4' 
+            className='h-full min-h-[300px] max-w-sm overflow-hidden rounded-md border border-gray-200 bg-white p-4'
🧰 Tools
🪛 eslint

[error] 26-26: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 26-26: Delete ·

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 26-26: Trailing spaces not allowed


[error] 26-26: Delete trailing whitespace


Line range hint 23-36: Consider accessibility and performance improvements.

  1. Using array index as key might cause issues with React's reconciliation if the studies array order changes.
  2. Add ARIA labels to improve accessibility for screen readers.
  3. Consider lazy loading images that might be below the fold.
-      {studies.map((study, index) => (
+      {studies.map((study) => (
-        <a key={index} href={`casestudies/${study.id}`}>
+        <a 
+          key={study.id}
+          href={`casestudies/${study.id}`}
+          aria-label={`Case study for ${study.company.name}`}
+        >
           <div
             className='h-full min-h-[300px] max-w-sm overflow-hidden rounded-md border border-gray-200 bg-white p-4'
             data-testid='CaseStudyCard-main'
           >
             <span className='mr-2'>
-              <img className='m-auto h-16' src={study.company.logo} alt={study.company.name} />
+              <img 
+                className='m-auto h-16' 
+                src={study.company.logo} 
+                alt={study.company.name}
+                loading="lazy"
+              />
🧰 Tools
🪛 eslint

[error] 26-26: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 26-26: Delete ·

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[warning] 22-22: Invalid Tailwind CSS classnames order


[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 26-26: Trailing spaces not allowed


[error] 26-26: Delete trailing whitespace

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 50b2beb and e2f8053.

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

[error] 26-26: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 26-26: Delete ·

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project
components/CaseStudyCard.tsx

[warning] 22-22: Invalid Tailwind CSS classnames order


[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 26-26: Trailing spaces not allowed


[error] 26-26: Delete trailing whitespace

⏰ Context from checks skipped due to timeout of 180000ms (4)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
🔇 Additional comments (1)
components/CaseStudyCard.tsx (1)

Line range hint 22-36: Implementation successfully addresses the height and spacing issues.

The changes effectively solve the misalignment problems by:

  1. Adding vertical spacing between cards with gap-y-3
  2. Ensuring consistent card heights with h-full and min-h-[300px]
  3. Maintaining proper responsive behavior between mobile and desktop views
🧰 Tools
🪛 eslint

[error] 26-26: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 26-26: Delete ·

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[warning] 22-22: Invalid Tailwind CSS classnames order


[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 26-26: Trailing spaces not allowed


[error] 26-26: Delete trailing whitespace

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Jan 10, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 33
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3561--asyncapi-website.netlify.app/

Copy link

@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: 1

🧹 Nitpick comments (1)
components/CaseStudyCard.tsx (1)

22-22: Optimize Tailwind class ordering for better maintainability.

Consider grouping related Tailwind classes together following this pattern: layout → spacing → responsive modifiers.

-    <div className='flex flex-wrap pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center gap-3'>
+    <div className='flex flex-wrap gap-3 pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center'>
🧰 Tools
🪛 GitHub Actions: PR testing - if Node project

[warning] 22-22: Invalid Tailwind CSS classnames order

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 869e249 and d779a39.

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

[error] 25-25: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 25-26: Replace ·⏎ with ⏎··

(prettier/prettier)


[error] 27-27: Replace data-testid='CaseStudyCard-main' with ··data-testid='CaseStudyCard-main'⏎··········

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project
components/CaseStudyCard.tsx

[warning] 22-22: Invalid Tailwind CSS classnames order


[error] 25-25: Trailing spaces not allowed


[error] 25-25: Replace spaces with proper indentation


[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 27-27: Incorrect indentation for data-testid attribute

🔇 Additional comments (1)
components/CaseStudyCard.tsx (1)

25-27: Height adjustments look good!

The addition of h-full and min-h-[300px] classes effectively addresses the height misalignment issue mentioned in PR #3544.

🧰 Tools
🪛 eslint

[error] 25-25: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 25-26: Replace ·⏎ with ⏎··

(prettier/prettier)


[error] 27-27: Replace data-testid='CaseStudyCard-main' with ··data-testid='CaseStudyCard-main'⏎··········

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[error] 25-25: Trailing spaces not allowed


[error] 25-25: Replace spaces with proper indentation


[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 27-27: Incorrect indentation for data-testid attribute

Comment on lines 25 to 27
<div
className='max-w-sm h-full overflow-hidden min-h-[300px] rounded-md border border-gray-200 bg-white p-4'
data-testid='CaseStudyCard-main'>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix formatting issues.

Address the following formatting issues:

  • Remove trailing spaces
  • Fix indentation
-          <div 
-          className='max-w-sm h-full overflow-hidden min-h-[300px] rounded-md border border-gray-200 bg-white p-4'
-          data-testid='CaseStudyCard-main'>
+          <div
+            className='max-w-sm h-full overflow-hidden min-h-[300px] rounded-md border border-gray-200 bg-white p-4'
+            data-testid='CaseStudyCard-main'
+          >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
className='max-w-sm h-full overflow-hidden min-h-[300px] rounded-md border border-gray-200 bg-white p-4'
data-testid='CaseStudyCard-main'>
<div
className='max-w-sm h-full overflow-hidden min-h-[300px] rounded-md border border-gray-200 bg-white p-4'
data-testid='CaseStudyCard-main'
>
🧰 Tools
🪛 eslint

[error] 25-25: Trailing spaces not allowed.

(no-trailing-spaces)


[error] 25-26: Replace ·⏎ with ⏎··

(prettier/prettier)


[error] 27-27: Replace data-testid='CaseStudyCard-main' with ··data-testid='CaseStudyCard-main'⏎··········

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[error] 25-25: Trailing spaces not allowed


[error] 25-25: Replace spaces with proper indentation


[warning] 26-26: Invalid Tailwind CSS classnames order


[error] 27-27: Incorrect indentation for data-testid attribute

Copy link
Member

@anshgoyalevil anshgoyalevil left a comment

Choose a reason for hiding this comment

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

@anshgoyalevil
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 67b292a into asyncapi:master Jan 10, 2025
20 checks passed
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (50b2beb) to head (ee88cd3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3561   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          668       668           
=========================================
  Hits           668       668           

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

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

Successfully merging this pull request may close these issues.

[BUG] Misalignment of Height and Spacing in Case Study Block on Desktop and Mobile Views.
3 participants