-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PWA-1707: Cleanup whishlist for render empty #3228
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple observations to look at, but this look pretty straight forward. Nice work 👍
@@ -27,7 +27,10 @@ const WishlistPage = props => { | |||
defaultMessage: 'The wishlist is not currently available.' | |||
}); | |||
const wishlistElements = useMemo(() => { | |||
if (wishlists.length === 0) return null; | |||
if (wishlists.length === 0) { | |||
return <Wishlist data={[]} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With all the destructuring happening in the component, was surprised to see it not complain about this array value. Instead of making the placeholder dependent on the developer passing some arbitrary special value, let's instead make <Wishlist />
with no data prop behave like a placeholder. That paired with adding defaultProps
to the component should accomplish the same thing with a better API.
Optionally, it looks like I missed adding propTypes
on that component. Would be nice to document if you are going to pass data, what is expected in that object to render correctly.
@@ -19,6 +19,10 @@ | |||
grid-auto-flow: column; | |||
} | |||
|
|||
.emptyListText { | |||
text-align: center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor UX observation; mocks appear to have a minimum height that isn't reflected here. Giving the grid container a min-height
is preferable here, but a simple line-height
here could accomplish the same thing. If you want to attempt min-height
solution, you'll need to give the grid alignment instructions, since it appears to want to stretch. If this has been approved by UX, no big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a padding: 2rem 0;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference is to let the grid align the content, but this is fine 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to send to QA. Please resolve linting and test failures though 🙂
packages/venia-ui/lib/components/WishlistPage/__tests__/wishlist.spec.js
Outdated
Show resolved
Hide resolved
@@ -19,6 +19,10 @@ | |||
grid-auto-flow: column; | |||
} | |||
|
|||
.emptyListText { | |||
text-align: center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference is to let the grid align the content, but this is fine 👍
…st.spec.js Co-authored-by: Tommy Wiebell <twiebell@adobe.com>
QA
|
Description
Clean up single wishlist
Related Issue
Closes PWA-1707
Acceptance
Verification Stakeholders
Specification
Verification Steps
My Account > Favorites shows a "there are currently no items in this list" message
After items are added and then removed back down to zero items, the "there are currently no items in this list" message shows again
Test Plan
Navigate to My Account > Favorites with a single, empty wishlist
See that the page shows the "no items" message
Add an item to the wishlist
Remove the item from the wishlist
See that the page again shows the "no items" message
Screenshots / Screen Captures (if appropriate)
Breaking Changes (if any)
Checklist