Skip to content

Conversation

@sylwia-werner
Copy link
Collaborator

@sylwia-werner sylwia-werner commented Nov 5, 2025

@sylwia-werner sylwia-werner requested a review from mikolvj November 5, 2025 12:31
@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
b2c-marketplace-storefront-4m3w Ready Ready Preview Comment Nov 12, 2025 8:59am
b2c-plugin-test Ready Ready Preview Comment Nov 12, 2025 8:59am
b2c-sandbox Ready Ready Preview Comment Nov 12, 2025 8:59am
mercurb2c-development Ready Ready Preview Comment Nov 12, 2025 8:59am
mercurb2c-testing Ready Ready Preview Comment Nov 12, 2025 8:59am

useEffect(() => {
handleSetProducts()
}, [items.length])
if (items.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any chance for items to be undefined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

useHits returns empty array if there's no items

const searchParams = useSearchParams()

const itemsKey = useMemo(
() => items.map((item) => item.objectID).join(","),
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any chance for items to be undefined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

useHits returns empty array if there's no items

<SkeletonProductCard key={idx} />
))}
</div>
) : !items.length ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

how about extracting 'no results view' and products view to separate component to remove this chained ternary operator?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Extracted the views. Also moved pagination component, it's now centered relative to the right section (not full page width like before), according to the design

apiProducts,
}: Props) => (
<div className="w-full">
<ul className="flex flex-wrap gap-4">
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we use <ul> here, we want to either wrap ProductCard in <li></li> to be semanticly correct, or change <ul> to <div>

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.

4 participants