Commit 4546db73 authored by tom's avatar tom

[skip ci] disable email field on profile page

parent 7141aa3c
......@@ -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"
......
......@@ -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) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment