Skip to content

fix: center event image and fix Join Now button navigation #7623#7633

Open
AnkitRewar11 wants to merge 1 commit intolayer5io:masterfrom
AnkitRewar11:fix/events-image-alignment-v2
Open

fix: center event image and fix Join Now button navigation #7623#7633
AnkitRewar11 wants to merge 1 commit intolayer5io:masterfrom
AnkitRewar11:fix/events-image-alignment-v2

Conversation

@AnkitRewar11
Copy link
Copy Markdown
Contributor

Description
This PR fixes #7623

The Events section on desktop had three issues:

  • Event banner image was misaligned with black/empty space around it
  • Extra black space was appearing below the "Join Now" button
  • "Join Now" button was not redirecting anywhere on click

What was wrong and what I fixed

src/components/UpcomingEventCard/EventCard.style.js

The image container was using object-fit: contain which shrinks the image to fit inside the box, leaving black/empty gaps around it. I changed it to object-fit: cover so the image fills the container properly. I also added flexbox centering (display: flex, align-items: center, justify-content: center) and overflow: hidden to make sure the image stays centered and does not overflow outside the container.

src/components/UpcomingEventCard/index.js

The "Join Now" button had $url={item.frontmatter.eurl} which was null or undefined for events that don't have an external registration link. This caused the button to render without any href, so clicking it did nothing. I added a fallback so if no external URL exists, it redirects to the internal event page instead. I also fixed $external={true} which was hardcoded — now it is $external={!!item.frontmatter.eurl} so only events with an external URL open in a new tab.

Notes for Reviewers
Only 2 files changed, 1 clean commit. The CI build:preview failure is a pre-existing issue in the repo and is not related to these changes.

Signed commits

  • Yes, I signed my commits.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

🚀 Preview deployment: https://layer5io.github.io/layer5/pr-preview/pr-7633/

Copy link
Copy Markdown
Member

@rishiraj38 rishiraj38 left a comment

Choose a reason for hiding this comment

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

Please attach a Before and After image for better reference.

@AnkitRewar11
Copy link
Copy Markdown
Contributor Author

AnkitRewar11 commented Apr 15, 2026

Before
Screenshot (185) (1)

after
Screenshot (184) (1)

Screen.Recording.2026-04-16.001011.mp4

@rishiraj38 here are the before and after results, along with a video recording after the changes.

@AnkitRewar11
Copy link
Copy Markdown
Contributor Author

@rishiraj38 These changes have now been applied to the other slide images as well, which weren’t working before.

Copy link
Copy Markdown
Member

@rishiraj38 rishiraj38 left a comment

Choose a reason for hiding this comment

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

Please revert the lints.



Signed-off-by: ankitrewar11 <ankitrewar11@gmail.com>
@AnkitRewar11 AnkitRewar11 force-pushed the fix/events-image-alignment-v2 branch from a90b873 to 00bed1c Compare April 16, 2026 19:55
@AnkitRewar11
Copy link
Copy Markdown
Contributor Author

Please revert the lints.

@rishiraj38 all set, please take a look again.

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.

[Bug] Events section - Image misalignment, extra whitespace, and broken "Join Now" button on desktop web

2 participants