Skip to content

Commit

Permalink
[skip ci] disable email field on profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Oct 21, 2024
1 parent 7141aa3 commit 4546db7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ui/myProfile/MyProfileEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ const MyProfileEmail = ({ profileQuery }: Props) => {
onSubmit={ formApi.handleSubmit(onFormSubmit) }
>
<MyProfileFieldsName/>
<MyProfileFieldsEmail isReadOnly={ !config.services.reCaptchaV3.siteKey } defaultValue={ profileQuery.data?.email || undefined }/>
{ config.services.reCaptchaV3.siteKey && (
<MyProfileFieldsEmail
isReadOnly={ !config.services.reCaptchaV3.siteKey || Boolean(profileQuery.data?.email) }
defaultValue={ profileQuery.data?.email || undefined }
/>
{ config.services.reCaptchaV3.siteKey && !profileQuery.data?.email && (
<GoogleReCaptchaProvider reCaptchaKey={ config.services.reCaptchaV3.siteKey }>
<FormFieldReCaptcha/>
</GoogleReCaptchaProvider>
) }
{ config.services.reCaptchaV3.siteKey && (
{ config.services.reCaptchaV3.siteKey && !profileQuery.data?.email && (
<Button
mt={ 6 }
size="sm"
Expand Down
2 changes: 1 addition & 1 deletion ui/myProfile/fields/MyProfileFieldsName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const MyProfileFieldsName = () => {
const isDisabled = formState.isSubmitting;

return (
<FormControl variant="floating" isDisabled={ isDisabled } size="md" cursor="not-allowed" mb={ 3 }>
<FormControl variant="floating" isDisabled={ isDisabled } size="md" mb={ 3 }>
<Input
{ ...field }
isInvalid={ Boolean(fieldState.error) }
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4546db7

Please sign in to comment.