Skip to content
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

Convert Collection to a function component #2366

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

lindapaiste
Copy link
Collaborator

Progress on #2358

Merge after #2253

Changes:

  • Convert Collection to a function component.
  • Use Redux hooks.
  • Don't fetch the collection from the API if it's already loaded.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

@lindapaiste lindapaiste changed the title Refactor/collection Convert Collection to a function component Aug 8, 2023
Copy link
Contributor

@PiyushChandra17 PiyushChandra17 left a comment

Choose a reason for hiding this comment

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

Nicely Done

@raclim raclim added this to the MINOR Release for 2.13.0 milestone Mar 5, 2024
Comment on lines +113 to +123
collection: PropTypes.shape({
id: PropTypes.string,
name: PropTypes.string,
slug: PropTypes.string,
description: PropTypes.string,
owner: PropTypes.shape({
username: PropTypes.string
}).isRequired,
items: PropTypes.arrayOf(PropTypes.shape({}))
}).isRequired,
isOwner: PropTypes.bool.isRequired
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@raclim it seemed like it made sense to pass down the collection object from the parent component since the parent already has the object. But I find these prop types super annoying so idk, I may roll back some of the changes in the CollectionMetadata file and access the collection with the useSelector.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That makes sense, it is pretty long! Thanks for the heads up!

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.

3 participants