Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Add countLabel prop to SearchListItem #2569

Merged
merged 2 commits into from
Jul 4, 2019

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Jul 3, 2019

In the Reviews by Product block we need to display X Reviews next to each product in the SearchListControl:
image

Currently, SearchListItem only allows showing a number (which comes from item.count). This PR adds a countLabel prop to SearchListItem that will overwrite what's rendered in the counter. Allowing the consumer to modify it.

Accessibility

Screenshots

image

Detailed test instructions:

		return <SearchListItem countLabel="Lorem Ipsum" showCount { ...args } />;
  • Go to WooCommerce > DevDocs.
  • Go to SearchListControl card and press Toggle loading state.
  • Verify the count label appears next to the list names (see screenshot above).

@Aljullu Aljullu added [Status] Needs Review focus: components Issues for woocommerce components labels Jul 3, 2019
@Aljullu Aljullu requested a review from a team July 3, 2019 11:53
@Aljullu Aljullu self-assigned this Jul 3, 2019
Copy link
Member

@mikejolley mikejolley left a comment

Choose a reason for hiding this comment

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

This works great. @timmyc There are a few instances in blocks that could use this (featured variations is one), as well as the new reviews block that is currently blocked by this. Would it be possible to get this in the package so we can use it?

@timmyc
Copy link
Contributor

timmyc commented Jul 4, 2019

Would it be possible to get this in the package so we can use it?

Indeed lets merge this and release a new version of components so you all can consume it in blocks 👍

@Aljullu Aljullu merged commit 350a2e2 into master Jul 4, 2019
@Aljullu Aljullu deleted the add/search-list-control-count-label branch July 4, 2019 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: components Issues for woocommerce components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants