-
Notifications
You must be signed in to change notification settings - Fork 63
Add ImageGrid component and use it for RelatedImages #281
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.
Great. There used to be such an irritating bug where if loading related images failed, the site would show related images from the previous image, due to these being held in a global store.
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.
Now these components seem more in line with the "Single-responsibility principle". Awesome!
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com> Co-authored-by: Zack Krida <zackkrida@pm.me>
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.
I love getting rid of global state 🎉 I'm running into some local dev issues so I can't test it though 😢
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.
LGTM!
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.
LGTM! 🚀
Fixes
Related #280 by @obulat
Description
This PR extracts the functionality of
SearchGridManualLoad
that has to do with displaying images and an optionalLoad more
button into a newImageGrid
component.RelatedImages
component is refactored to be responsible for fetching related images, and useImageGrid
to display them. This makes theimages
part ofrelated
Vuex store unnecessary, and also simplifies the VuexisFetching
andisFetchingError
states: now they are only changed by Image search and Single image result [which should actually control its state separately].I think the
SearchGrid
component will also need to be refactored to use theImageGrid
component later.The
ImageCell
is copied as-is from theSearchGridCell
to ensure that possible changes later do not introduce unwanted bugs.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin