-
-
Notifications
You must be signed in to change notification settings - Fork 980
fix: centered card in casestudies page #3805
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
Changes from 3 commits
06ada4d
bbcb787
f051a96
08df39e
f1c8c54
7f40c5b
6b1a7b0
eeab2c2
71c818c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,11 +19,11 @@ export default function CaseStudyCard({ studies = [] }: ICaseStudyCardProps) { | |
| } | ||
|
|
||
| return ( | ||
| <div className='flex flex-wrap gap-3 pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center'> | ||
| <div className='flex flex-wrap gap-3 pt-10 lg:flex lg:items-center lg:justify-center lg:gap-8 lg:text-center'> | ||
| {studies.map((study, index) => ( | ||
| <a key={index} href={`casestudies/${study.id}`}> | ||
| <div | ||
| className='h-full min-h-[300px] max-w-sm overflow-hidden rounded-md border border-gray-200 bg-white p-4' | ||
| className='h-full min-h-[300px] max-w-sm overflow-hidden lg:w-[350px] rounded-md border border-gray-200 bg-white p-4' | ||
|
||
| data-testid='CaseStudyCard-main' | ||
| > | ||
| <span className='mr-2'> | ||
|
|
||
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.
Since we are using flex for all viewports, can't we simplify this to use flex in all viewports?
@coderabbitai can you suggest something here?
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.
@akshatnema You're absolutely right! Since we're using flex layout for all viewports now, we can simplify this by removing the redundant
lg:flex. Here's a simplified version:This removes the duplicate flex declaration while preserving all the functionality.
If you want items centered on all viewports (not just large screens), you could further simplify to:
This would depend on the desired mobile layout - does it need center alignment everywhere or just on larger screens?
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.
@cbum-dev Can you please make this change?
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.