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

Add partial like in item with variants #338

Conversation

renaudjenny
Copy link
Collaborator

  • Add an half star to show that the item has been partially completed, meaning at least one of its variants is liked, but not all of them.
  • Display bottom sheet variations if the item has variants instead of adding it to the collection without their variants.
  • Fix Urgently need fix #230

* Add an half star to show that the item has been partially completed,
  meaning at least one of its variants is liked, but not all of them.
* Display bottom sheet variations if the item has variants instead of
  adding it to the collection without their variants.
* Previously the item wasn't marked as liked if one of its variant is
  liked
@renaudjenny
Copy link
Collaborator Author

LOL I wanted to show a video recording of the result, but it's now impossible to upload video on GitHub :(

@renaudjenny
Copy link
Collaborator Author

Screen Recording 2020-12-28 at 15 07 16

@renaudjenny renaudjenny mentioned this pull request Dec 29, 2020

if !items.contains(item) && variants.completionStatus(for: item) != .unstarted {
// We add the item to the liked items if at least one of its variant is added
toggleItem(item: item)
Copy link
Owner

Choose a reason for hiding this comment

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

You should _ = to silence the warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

toggleItem(item: item)
} else if items.contains(item) && variants.completionStatus(for: item) == .unstarted {
// We remove the item from the liked items if there is none of its variants liked
toggleItem(item: item)
Copy link
Owner

Choose a reason for hiding this comment

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

Same

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, I'm also wondering if at the end of the day @discardableResult could come handy for the function. As it's not used in a lot of places, I think that's fine for now.

@Dimillian
Copy link
Owner

I love the functionality and it works very good from the list, but it missing two things.

  • An animation when the bottom sheet is presented / dismissed.
  • When you're on the item detail screen, the favorite button in the navigation bar is doing nothing, it should also present this bottom sheet.

Appart from that, awesome!

@renaudjenny
Copy link
Collaborator Author

Hi @Dimillian, yes good idea, I will work on that today 🙂

* Also refactor the Bottom sheet view to let it be in its own View
* Add the behaviour inside the ItemDetailView for the main Like button,
  so it fixes the "doing nothing" behaviour
@renaudjenny
Copy link
Collaborator Author

@Dimillian, animation is done, I really like it! Let me know if you do too �

@Dimillian
Copy link
Owner

Love it! LGTM!

@renaudjenny renaudjenny merged commit c452f40 into Dimillian:main Jan 4, 2021
@renaudjenny renaudjenny deleted the 230-feat-add-partial-like-in-item-with-variants branch January 4, 2021 17:38
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.

Urgently need fix
2 participants