Skip to content

feat: add sale and new badges to product card#124

Open
stacelKonrad wants to merge 1 commit intomainfrom
feat/shopin-23/adjust_badge_component
Open

feat: add sale and new badges to product card#124
stacelKonrad wants to merge 1 commit intomainfrom
feat/shopin-23/adjust_badge_component

Conversation

@stacelKonrad
Copy link
Copy Markdown
Collaborator

  • add sale and new badge to product card component
  • add yellow color for badges

@stacelKonrad stacelKonrad requested a review from a team April 24, 2026 13:17
@stacelKonrad stacelKonrad linked an issue Apr 24, 2026 that may be closed by this pull request
5 tasks
)}
>
{data?.badges && data.badges.length > 0 && (
<div className='pointer-events-auto absolute top-2 left-2 z-10 flex flex-col items-start gap-1'>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let badge clicks reach the card link. When a product has badges, this new absolutely positioned wrapper sits above the full-card Link (z-10 vs z-1) and uses pointer-events-auto. Since the badge overlay has no click handler, clicking the badge area in the top-left of the image does nothing instead of opening the product. Make this noninteractive overlay ignore pointer events so the card link still receives the click.

red: 'bg-red-400 text-white',
gray: 'bg-gray-200 text-gray-700 focus-visible:ring-gray-200/80',
yellow: 'bg-orange-500 text-gray-950 focus-visible:ring-yellow-500/80',
yellow: 'bg-yellow-500 text-white focus-visible:ring-yellow-500/80',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure if contrast is not to low between text and bg. Maybe text-gray-900 would be better?

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.

FEAT: Badge component

2 participants