Skip to content

Netflix Artworks implementation#1

Open
marlonpp wants to merge 2 commits intovinodkl:masterfrom
marlonpp:mp.artwork
Open

Netflix Artworks implementation#1
marlonpp wants to merge 2 commits intovinodkl:masterfrom
marlonpp:mp.artwork

Conversation

@marlonpp
Copy link
Copy Markdown

Hi @vinodkl, please review this PR and give me your thoughts.

Description:
This PR implements Netflix Artworks App allows the user to see a list of Artworks paginated, and grouped by a category of his choice, currently supporting movieId and languageCode.

Clicking in one of the Artworks in the list will allow the user to see the Artwork details containing:
Full size image.
Movie Id.
Movie Name.
Image Type.
Language Code.

Marlon Parizzotto and others added 2 commits January 15, 2017 20:22
… of Artworks paginated, and grouped by a category of his choice, currently supporting movieId and languageCode.

Clicking in one of the Artworks in the list will allow the user to see the Artwork details containing:
Full size image.
Movie Id.
Movie Name.
Image Type.
Language Code.
This commit fixes a typo at Production instructions.
Copy link
Copy Markdown
Owner

@vinodkl vinodkl left a comment

Choose a reason for hiding this comment

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

Great work. couple of comments added. Thanks.

const groupedArtworks = { ...state };
switch (action.type) {
case types.LOAD_ARTWORKS_SUCCESS:
groupByArray.forEach((group) => {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

on loading the data set from server, any reason why do we need to do this bucketing for all the groups at once? what if the there are 100's of grouping points? what if the user is interested in only one group?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I really liked the data structure, but I agree with you that this could be a 2 step transformation.

1 - Just transform for the default group option.
2 - Lazely do it when the user select a new one.

This way we would not do any transformation work without needing it.

* @return list of ArtworkListItem separated by Subheader (sections).
**/
function generateList(groupedArtworks, groupBy, size, onExpand) {
const itemList = [];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

do you think the current setup would help in handling 1000's of artworks on the page scroll? what would you do differently to handle the scroll performance.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The current setup is paginated, but the user can choose to show all Items by pressing the "Show All" button, that would render all 1000's of Artworks. A way of solving it is using something like react-virtualized (https://github.com/bvaughn/react-virtualized) that would just render what is being shown. If using the library is not possible, this could be implemented by listening to the scroll events and rendering new items when needed.

@marlonpp
Copy link
Copy Markdown
Author

Thanks for taking the time to review the code.

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.

2 participants