Conversation
…nd modified ReadMe file
provider_profile_and_user_dev: Added ProviderProfile Component Code a…
Reviewer's GuideThis PR revamps the provider profile feature by replacing static markup with a dynamic, state-driven form and a dedicated service for updates, introduces a new ProfileMenu for user actions, cleans up redundant code, fixes a prediction service endpoint, and reorganizes documentation sections and diagrams. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Riyad-Murad - I've reviewed your changes - here's some feedback:
- Consider removing the large block of commented-out code in InputField.jsx to keep the component clean and maintainable.
- The fixed 300px margin-left in your profile wrapper CSS could break across different layouts—consider using a more responsive approach (e.g., flex/grid or theme-based spacing).
- The profile form currently allows submitting without any validation or loading feedback; adding basic client-side validation and a disabled/loading state on submit would improve the UX.
Here's what I looked at during the review
- 🟡 General issues: 4 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| <div className="provider-profile-card"> | ||
| <h2 className="provider-profile-subtitle">Edit Provider Profile</h2> | ||
| <form className="provider-profile-form"> |
There was a problem hiding this comment.
suggestion (bug_risk): Attach handleSubmit to form onSubmit instead of button onClick
Also update the button to type="submit" so pressing Enter submits the form and you don’t mix click and submit events.
Suggested implementation:
<form className="provider-profile-form" onSubmit={handleSubmit}> <button
type="submit"
className="provider-profile-submit"
>| import ActionButton from "../../../Components/CommonComponents/ActionButton/ActionButton"; | ||
|
|
||
| const ProviderProfile = () => { | ||
| const [formData, setFormData] = useState({ |
There was a problem hiding this comment.
suggestion: Profile form fields initialized as empty
Fetch existing profile data on mount to pre-fill the form and avoid forcing users to re-enter unchanged values.
| name: "", | ||
| email: "", | ||
| password: "", | ||
| phone_number: "", |
There was a problem hiding this comment.
suggestion: Use consistent camelCase naming for JavaScript fields
phone_number is snake_case; change it to phoneNumber and adjust the API mapping as needed.
| toast.success("Profile updated successfully."); | ||
| setTimeout(() => navigate("/provider/dashboard"), 1000); |
There was a problem hiding this comment.
suggestion: Avoid setTimeout for post-update navigation
A fixed timeout can lead to inconsistent UX—navigate in the toast’s onClose callback or immediately after the success response.
| toast.success("Profile updated successfully."); | |
| setTimeout(() => navigate("/provider/dashboard"), 1000); | |
| toast.success("Profile updated successfully.", { | |
| onClose: () => navigate("/provider/dashboard"), | |
| }); |
Summary by Sourcery
Enable providers to edit their profiles via a revamped UI that validates inputs, filters empty fields, and shows success or error toasts before redirecting. Introduce a dropdown-based ProfileMenu in the sidebar and update styles. Also refine README diagrams and add API reference.
New Features:
Bug Fixes:
Enhancements:
Documentation: