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

Converts EditCustomerDetailsModal to a functional component using hooks #742

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

rhonsby
Copy link
Collaborator

@rhonsby rhonsby commented Apr 16, 2021

Description

As @reichert621 suggested in #736, EditCustomerDetailsModal was a good opportunity to convert into a functional component using hooks especially since it didn't make use of any of the lifecycle methods.

This commit does that and also splits the toggleIsEditModalVisible method into two separate methods to be more declarative.

Screenshots

Edit + delete flow

CleanShot.2021-04-16.at.08.31.00.mp4

Default errors when fail to update + delete

CleanShot.2021-04-16.at.08.39.47.mp4

Using server errors when fail to update + delete

CleanShot.2021-04-16.at.08.39.11.mp4

Checklist

  • Everything passes when running mix test
  • Ran mix format
  • No frontend compilation warnings

@rhonsby rhonsby requested a review from reichert621 April 16, 2021 12:34
@a8t
Copy link
Contributor

a8t commented Apr 16, 2021

This looks like a good place to try out React Query as well. If I have time this weekend I'll make a PR showing how this component would look using these fetching hooks.

Copy link
Collaborator

@reichert621 reichert621 left a comment

Choose a reason for hiding this comment

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

nice!

@reichert621 reichert621 merged commit 56386fe into master Apr 16, 2021
@reichert621 reichert621 deleted the edit-customer-details-follow-up branch April 16, 2021 13:21
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