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

Refactor EditProfileForm component and useUserProfile hook #185

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

mayura-andrew
Copy link
Member

Purpose

The purpose of this PR is to fix #184

Goals

  • Enable the submit button only when the user has made changes to the profile information or uploaded a new profile photo.
  • Successfully allow users to update their details, including first name, last name, and profile photo.

Approach

  • The useUserProfile hook manages the state for the user's profile information and profile picture.
  • It initializes the profile state with the user's current information and updates the state when the user changes any input field or uploads a new profile photo.
  • The handleProfilePicChange function updates the profile picture state and creates a URL for the uploaded image.

Screenshots

Checklist

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related PRs

Test environment

NodeJS - v20.15.0
FireFox - v129

Learning

React Custom Hooks

Copy link
Member

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

Good job! @mayura-andrew

@anjula-sack anjula-sack merged commit 7a275b9 into sef-global:main Sep 9, 2024
3 checks passed
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.

User Profile Update Fails Due to Missing Required Fields Error
2 participants