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

changed columns from 3 to 2,added vertical spacing in mobile view #3511

Closed

Conversation

Sonalilipsa17375
Copy link

@Sonalilipsa17375 Sonalilipsa17375 commented Dec 22, 2024

Title:- Fixed card layout issues

Description

  • Grid Column Fix - The grid columns were set to 3; changed to 2 for better alignment .
  • Uniform Card Height - Fixed the uniformity of the cards height ,which was not uniform.
  • Mobile View Spacing - There was no spacing between cards in mobile view .
  • Hover Effect- Added a subtle hover effect to the cards,enhanced ui .

Before changes desktop view

Screenshot From 2024-12-23 03-08-18

Before changes mobile view

Screenshot From 2024-12-23 03-22-58

after changes in desktop view

Screenshot From 2024-12-23 02-21-49

after changes in mobile view
Screenshot From 2024-12-23 03-28-41

Testing Results:

Before:

Misaligned grid with 3 columns.
Inconsistent card heights.
No spacing between cards in mobile view.

After:

2-column grid layout.
Uniform card heights.
Adequate spacing in mobile view.
Enhanced hover effect for better interactivity

Summary by CodeRabbit

  • New Features

    • Enhanced layout of case study cards using a grid system for improved arrangement and responsiveness.
    • Introduced hover effects with scaling and shadow for better visual feedback.
  • Bug Fixes

    • Ensured consistent height across case study cards with a minimum height setting.
  • Style

    • Updated text alignment and spacing for improved presentation of case study descriptions.

Copy link

coderabbitai bot commented Dec 22, 2024

Walkthrough

The pull request modifies the CaseStudyCard component in components/CaseStudyCard.tsx, transitioning from a flexbox to a grid layout. The changes focus on improving the visual structure, responsiveness, and interaction of case study cards. The component now features a more consistent layout with explicit height, centered text, and enhanced hover effects that include scaling and shadow transformations.

Changes

File Change Summary
components/CaseStudyCard.tsx - Switched from flexbox to grid layout
- Added responsive column configuration (lg:grid-cols-2)
- Implemented vertical spacing with gap-y
- Set fixed minHeight of 300px for cards
- Enhanced hover effects with scaling and shadow
- Centered text alignment for descriptions

Suggested labels

ready-to-merge

Suggested reviewers

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

Possibly related PRs

Poem

🐰 Grid by grid, the cards now dance,
With shadows soft and scaling glance,
A rabbit's touch of design delight,
Making case studies leap with might!
Responsive magic, pixel-perfect flight! 🎨


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

@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 Dec 22, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 98cee06
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67688cb06944830008f2e7c6
😎 Deploy Preview https://deploy-preview-3511--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.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Dec 22, 2024

⚡️ Lighthouse report for the changes in this PR:

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

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

@asyncapi-bot
Copy link
Contributor

We require all PRs to follow Conventional Commits specification.
More details 👇🏼

 No release type found in pull request title "changed columns from 3 to 2,added vertical spacing in mobile view". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

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: 2

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

27-27: Consider using Tailwind class for min-height

Instead of using inline style, consider using Tailwind's min-height utilities for better consistency and maintainability.

-        style={{ minHeight: '300px' }}
+        className="min-h-[300px] flex flex-col items-center h-full overflow-hidden rounded-md border border-gray-200 bg-white p-4 transform transition-transform duration-300 hover:scale-105 hover:shadow-lg"
🧰 Tools
🪛 eslint

[error] 27-27: Insert ····

(prettier/prettier)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2327eae and 98cee06.

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

[error] 22-22: Replace "grid·gap-y-4·pt-10·sm:gap-y-6·lg:grid-cols-2·lg:gap-y-8·lg:justify-items-center·lg:gap-x-0" with 'grid·gap-y-4·pt-10·sm:gap-y-6·lg:grid-cols-2·lg:gap-y-8·lg:justify-items-center·lg:gap-x-0'

(prettier/prettier)


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

(jsx-quotes)


[error] 23-23: Insert ····

(prettier/prettier)


[error] 24-24: Replace ····<a·key={index}·href={casestudies/${study.id}}·className="w-full·max-w-sm" with ········<a·key={index}·href={casestudies/${study.id}}·className='w-full·max-w-sm'

(prettier/prettier)


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

(jsx-quotes)


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

(prettier/prettier)


[error] 26-26: Replace ········className="flex·flex-col·items-center·h-full·overflow-hidden·rounded-md·border·border-gray-200·bg-white·p-4·transform·transition-transform·duration-300·hover:scale-105·hover:shadow-lg" with ············className='flex·flex-col·items-center·h-full·overflow-hidden·rounded-md·border·border-gray-200·bg-white·p-4·transform·transition-transform·duration-300·hover:scale-105·hover:shadow-lg'

(prettier/prettier)


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

(jsx-quotes)


[error] 27-27: Insert ····

(prettier/prettier)


[error] 28-28: Replace data-testid="CaseStudyCard-main" with ····data-testid='CaseStudyCard-main'

(prettier/prettier)


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

(jsx-quotes)


[error] 29-29: Replace ······ with ··········

(prettier/prettier)


[error] 30-30: Replace ········<span·className="mr-2">· with ············<span·className='mr-2'>

(prettier/prettier)


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

(jsx-quotes)


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

(no-trailing-spaces)


[error] 31-31: Replace ··········<img·className="m-auto·h-16" with ··············<img·className='m-auto·h-16'

(prettier/prettier)


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

(jsx-quotes)


[error] 32-32: Replace ········ with ············

(prettier/prettier)


[error] 33-33: Replace ········<Paragraph·typeStyle={ParagraphTypeStyle.md}·className="my-4·text-center" with ············<Paragraph·typeStyle={ParagraphTypeStyle.md}·className='my-4·text-center'

(prettier/prettier)


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

(jsx-quotes)


[error] 34-34: Replace ·········· with ··············

(prettier/prettier)


[error] 35-35: Replace ········ with ············

(prettier/prettier)


[error] 36-36: Insert ····

(prettier/prettier)


[error] 37-37: Replace ···· with ········

(prettier/prettier)


[error] 38-38: Insert ····

(prettier/prettier)


[error] 39-40: Replace </div>⏎ with ····</div>

(prettier/prettier)

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

22-22: Grid layout implementation aligns with requirements

The transition to a 2-column grid layout with responsive spacing matches the PR objectives. The progressive gap scaling (gap-y-4 → gap-y-6 → gap-y-8) ensures proper vertical spacing across viewports.

Let's verify the mobile view spacing:

✅ Verification successful

Grid layout implementation is correct and consistent

The grid layout implementation in CaseStudyCard.tsx is properly implemented and aligns with both the requirements and the broader codebase patterns. The search results confirm:

  • The component correctly implements a 2-column layout for larger screens (lg:grid-cols-2)
  • The progressive spacing (gap-y-4 → gap-y-6 → gap-y-8) follows similar responsive patterns seen elsewhere in the codebase
  • No conflicting grid styles are present in this component
  • The implementation is consistent with other grid layouts in the codebase that transition from single to multi-column layouts at different breakpoints
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any other grid-related styles that might conflict
rg "grid-cols-[123]" --type tsx

Length of output: 61


Script:

#!/bin/bash
# Check for any other grid-related styles that might conflict, using correct file extension
rg "grid-cols-[123]" --type ts --type tsx --type jsx --type js

Length of output: 92


Script:

#!/bin/bash
# Search for grid-related styles without file type restrictions
rg "grid-cols-[123]"

# Also check for the specific component file
cat components/CaseStudyCard.tsx || true

Length of output: 5974

🧰 Tools
🪛 eslint

[error] 22-22: Replace "grid·gap-y-4·pt-10·sm:gap-y-6·lg:grid-cols-2·lg:gap-y-8·lg:justify-items-center·lg:gap-x-0" with 'grid·gap-y-4·pt-10·sm:gap-y-6·lg:grid-cols-2·lg:gap-y-8·lg:justify-items-center·lg:gap-x-0'

(prettier/prettier)


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

(jsx-quotes)

Comment on lines +30 to +32
<span className="mr-2">
<img className="m-auto h-16" src={study.company.logo} alt={study.company.name} />
</span>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove unnecessary span wrapper

The span with mr-2 class appears to serve no purpose as it's the only child in a centered flex container.

-        <span className="mr-2"> 
-          <img className="m-auto h-16" src={study.company.logo} alt={study.company.name} />
-        </span>
+        <img className="m-auto h-16" src={study.company.logo} alt={study.company.name} />
📝 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
<span className="mr-2">
<img className="m-auto h-16" src={study.company.logo} alt={study.company.name} />
</span>
<img className="m-auto h-16" src={study.company.logo} alt={study.company.name} />
🧰 Tools
🪛 eslint

[error] 30-30: Replace ········<span·className="mr-2">· with ············<span·className='mr-2'>

(prettier/prettier)


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

(jsx-quotes)


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

(no-trailing-spaces)


[error] 31-31: Replace ··········<img·className="m-auto·h-16" with ··············<img·className='m-auto·h-16'

(prettier/prettier)


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

(jsx-quotes)


[error] 32-32: Replace ········ with ············

(prettier/prettier)

</div>
<div className="grid gap-y-4 pt-10 sm:gap-y-6 lg:grid-cols-2 lg:gap-y-8 lg:justify-items-center lg:gap-x-0">
{studies.map((study, index) => (
<a key={index} href={`casestudies/${study.id}`} className="w-full max-w-sm">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid using array index as key prop

Using array indices as keys can lead to issues with component state and performance when the list items are reordered, removed, or inserted.

Consider using a unique identifier from the study object:

-    <a key={index} href={`casestudies/${study.id}`} className="w-full max-w-sm">
+    <a key={study.id} href={`casestudies/${study.id}`} className="w-full max-w-sm">
📝 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
<a key={index} href={`casestudies/${study.id}`} className="w-full max-w-sm">
<a key={study.id} href={`casestudies/${study.id}`} className="w-full max-w-sm">
🧰 Tools
🪛 eslint

[error] 24-24: Replace ····<a·key={index}·href={casestudies/${study.id}}·className="w-full·max-w-sm" with ········<a·key={index}·href={casestudies/${study.id}}·className='w-full·max-w-sm'

(prettier/prettier)


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

(jsx-quotes)

@anshgoyalevil
Copy link
Member

@Sonalilipsa17375 Kindly file an issue and wait for a triage. More information about it is available in the Contributors Guide.

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