Conversation
|
womencodingcommunity
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on this fix @joanaBrit! 🎉
Here is a review with a few suggestions and required adjustments:
🚨 Unintended Dependency & Lockfile Changes
package.json&package-lock.json:- The project standardizes on
pnpm(usingpnpm-lock.yaml). Modifyingpackage-lock.jsonindicatesnpm installwas likely run locally. react-hook-formwas bumped from^7.66.0to^7.76.1, which is unrelated to this UI styling fix.- 👉 Action: Please revert the changes to
package.jsonandpackage-lock.json.
- The project standardizes on
🔍 Suggestions & Improvements for src/components/EventCard.tsx
-
Flex Spacing vs. Margins:
gap: isMobile ? '18px' : '24px'is applied to the parent container, but the image<Box>also hasmarginLeft: isMobile ? 0 : '0.5rem'andmarginBottom: isMobile ? '1rem' : 0.- This creates asymmetric / compound spacing. We can remove
marginLeftandmarginBottomfrom the image<Box>and let flexgaphandle item spacing cleanly.
-
Explicit Dimensions &
flexShrinkon Image Container:- The image container currently uses
minWidthandminHeight. Because Next.js<Image fill />is absolutely positioned (0pxin-flow height), setting explicitwidth,height, andflexShrink: 0ensures the image won't collapse or squeeze when text/titles are long:width: isMobile ? '100%' : 220, height: isMobile ? 180 : 120, flexShrink: 0,
- The image container currently uses
-
Performance (
sizesprop):- When using
fill, Next.js defaults tosizes="100vw". Addingsizes="(max-width: 544px) 100vw, 220px"helps Next.js serve properly sized image assets.
- When using
-
Unit Consistency:
borderRadius: '.6rem'can be updated to'8px'(or theme radius tokens) to match project conventions.
💡 Suggested Snippet for src/components/EventCard.tsx
<Box
sx={{
display: 'flex',
flexDirection: isMobile ? 'column-reverse' : 'row-reverse',
gap: isMobile ? '18px' : '24px',
alignItems: 'flex-start',
}}
>
<Box
sx={{
position: 'relative',
width: isMobile ? '100%' : 220,
height: isMobile ? 180 : 120,
flexShrink: 0,
overflow: 'hidden',
borderRadius: '8px',
}}
>
<Image
src={images[0].path}
alt={images[0].alt}
data-testid="event-card-image"
fill
sizes="(max-width: 544px) 100vw, 220px"
style={{
objectFit: 'cover',
objectPosition: 'top',
}}
priority
/>
</Box>
<Box sx={{ flexGrow: 1 }}>
{/* Type, Date, Title, Speaker */}
</Box>
</Box>Great job simplifying the image rendering with <Image fill /> and aligning the mobile layout! 👍
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Updated the event card image styling to better match the website "https://www.womencodingcommunity.com/"
Type
Related Issue
Screenshots
Desktop view:

Mobile view:

Testing
Tested changes locally
Pull request checklist
Please check if your PR fulfills the following requirements: