-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Changes from 1 commit
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,22 +19,24 @@ export default function CaseStudyCard({ studies = [] }: ICaseStudyCardProps) { | |||||||||
} | ||||||||||
|
||||||||||
return ( | ||||||||||
<div className='flex flex-wrap pt-10 lg:grid lg:grid-cols-3 lg:gap-8 lg:text-center'> | ||||||||||
{studies.map((study, index) => ( | ||||||||||
<a key={index} href={`casestudies/${study.id}`}> | ||||||||||
<div | ||||||||||
className='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} /> | ||||||||||
</span> | ||||||||||
<Paragraph typeStyle={ParagraphTypeStyle.md} className='my-4'> | ||||||||||
{study.company.description} | ||||||||||
</Paragraph> | ||||||||||
</div> | ||||||||||
</a> | ||||||||||
))} | ||||||||||
</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"> | ||||||||||
<div | ||||||||||
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" | ||||||||||
style={{ minHeight: '300px' }} | ||||||||||
data-testid="CaseStudyCard-main" | ||||||||||
> | ||||||||||
<span className="mr-2"> | ||||||||||
<img className="m-auto h-16" src={study.company.logo} alt={study.company.name} /> | ||||||||||
</span> | ||||||||||
Comment on lines
+30
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove unnecessary span wrapper The span with - <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
Suggested change
🧰 Tools🪛 eslint[error] 30-30: Replace (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 (prettier/prettier) [error] 31-31: Unexpected usage of doublequote. (jsx-quotes) [error] 32-32: Replace (prettier/prettier) |
||||||||||
<Paragraph typeStyle={ParagraphTypeStyle.md} className="my-4 text-center"> | ||||||||||
{study.company.description} | ||||||||||
</Paragraph> | ||||||||||
</div> | ||||||||||
</a> | ||||||||||
))} | ||||||||||
</div> | ||||||||||
|
||||||||||
); | ||||||||||
} |
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.
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:
📝 Committable suggestion
🧰 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)