-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: profile view #1
Conversation
This reverts commit fd36070.
@arrocke Alrighty, this is finally ready. I had done most of the coding before your message in slack, so it has verification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! A couple things to cleanup and then this should be good.
action={async ( | ||
_prevState: FormState, | ||
data: FormData | ||
): Promise<FormState> => { | ||
const formSubmissionState = await updateProfile(_prevState, data); | ||
if (formSubmissionState.state === "error") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the more nextjs way of doing this would be to call revalidatePath
with the path of the profile view. That will trigger nextjs to rerender the view, which will reset the password field. Then we don't need a separate component to handle this on the client side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arrocke I'm having difficulty getting this to work, could you review my changes and see what I am doing wrong? I addressed the other issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to the main branch to automatically clear password inputs after a form is submitted. That should address your issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ready to merge once the issues with the messages file are addressed
messages/en.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are still issues with this file. It looks like a bunch of stuff got added to the end. Can you take another look?
action={async ( | ||
_prevState: FormState, | ||
data: FormData | ||
): Promise<FormState> => { | ||
const formSubmissionState = await updateProfile(_prevState, data); | ||
if (formSubmissionState.state === "error") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to the main branch to automatically clear password inputs after a form is submitted. That should address your issue.
"ProfileView": { | ||
"form": { | ||
"confirm_password": "Confirm Password", | ||
"email": "Email", | ||
"name": "Name", | ||
"password": "Password", | ||
"submit": "Update" | ||
}, | ||
"errors": { | ||
"email_required": "Please enter your email.", | ||
"email_format": "Please enter a valid email.", | ||
"name_required": "Please input your name", | ||
"password_confirmation": "Your password confirmation does not match.", | ||
"password_format": "Your password should be at least 8 characters." | ||
}, | ||
"profile_updated": "Profile updated successfully!", | ||
"title": "Profile", | ||
"update_profile": "Update Profile" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, this is the only change I made to en.json
.
What's Changed:
[locale]/profile
pathQA: