-
Notifications
You must be signed in to change notification settings - Fork 461
chore(clerk-js): Replace text and email fields with Form.PlainInput #2036
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/clerk-js': patch | ||
| --- | ||
|
|
||
| Replace Form.Control with Form.PlainInput for text and email inputs. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@clerk/localizations': patch | ||
| '@clerk/clerk-js': patch | ||
| '@clerk/types': patch | ||
| --- | ||
|
|
||
| Localize placeholder of confirmation field when deleting a user account from `<UserProfile/>`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,6 @@ export const ProfileSettingsPage = withCardStateProvider(() => { | |
| const dataChanged = organization.name !== nameField.value || organization.slug !== slugField.value; | ||
| const canSubmit = (dataChanged || avatarChanged) && slugField.feedbackType !== 'error'; | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/require-await | ||
| const onSubmit = async (e: React.FormEvent) => { | ||
| e.preventDefault(); | ||
| return (dataChanged ? organization.update({ name: nameField.value, slug: slugField.value }) : Promise.resolve()) | ||
|
|
@@ -90,17 +89,16 @@ export const ProfileSettingsPage = withCardStateProvider(() => { | |
| onAvatarRemove={isDefaultImage(organization.imageUrl) ? null : onAvatarRemove} | ||
| /> | ||
| <Form.ControlRow elementId={nameField.id}> | ||
| <Form.Control | ||
| <Form.PlainInput | ||
| {...nameField.props} | ||
| autoFocus | ||
| required | ||
| isRequired | ||
| /> | ||
| </Form.ControlRow> | ||
| <Form.ControlRow elementId={slugField.id}> | ||
| <Form.Control | ||
| <Form.PlainInput | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ This was required before, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with the previous implementation of |
||
| {...slugField.props} | ||
| onChange={onChangeSlug} | ||
| required | ||
| /> | ||
| </Form.ControlRow> | ||
| <FormButtons isDisabled={!canSubmit} /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ export const DeletePage = withCardStateProvider(() => { | |
| type: 'text', | ||
| label: localizationKeys('formFieldLabel__confirmDeletion'), | ||
| isRequired: true, | ||
| placeholder: 'Delete account', | ||
| placeholder: localizationKeys('formFieldInputPlaceholder__confirmDeletionUserAccount'), | ||
| }); | ||
|
|
||
| const canSubmit = confirmationField.value === 'Delete account'; | ||
|
|
@@ -45,10 +45,7 @@ export const DeletePage = withCardStateProvider(() => { | |
| <Text localizationKey={localizationKeys('userProfile.deletePage.actionDescription')} /> | ||
|
|
||
| <Form.ControlRow elementId={confirmationField.id}> | ||
| <Form.Control | ||
| {...confirmationField.props} | ||
| required | ||
| /> | ||
| <Form.PlainInput {...confirmationField.props} /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ Same question about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| </Form.ControlRow> | ||
| <FormButtons | ||
| submitLabel={localizationKeys('userProfile.deletePage.confirm')} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,6 @@ export const EmailPage = withCardStateProvider(() => { | |
|
|
||
| const canSubmit = emailField.value.length > 1 && user.username !== emailField.value; | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/require-await | ||
| const addEmail = async (e: React.FormEvent) => { | ||
| e.preventDefault(); | ||
| return user | ||
|
|
@@ -57,9 +56,8 @@ export const EmailPage = withCardStateProvider(() => { | |
| > | ||
| <Form.Root onSubmit={addEmail}> | ||
| <Form.ControlRow elementId={emailField.id}> | ||
| <Form.Control | ||
| <Form.PlainInput | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prop is coming from the hook |
||
| {...emailField.props} | ||
| required | ||
| autoFocus | ||
| /> | ||
| </Form.ControlRow> | ||
|
|
||
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.
❓ Shouldn't this have the
isRequiredproperty?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.
the hook above is defined as
so we are good